Making a client side script Server Side

T

Tim Greer

Thomas said:
Tim said:
Thomas said:
Tim Greer wrote:
Thomas 'PointedEars' Lahn wrote:
Tim Greer wrote:
Yonih wrote:
I need some help the following scrip below is used to write
the date however its client side so its pulling the date
from the visitors computer. Does anyone know a way to make
it server side so it will get its date from the server and
I don't have to worry about people's computer date being
wrong or manipulating it since it has to do with prices we
will be paying for that date.
JavaScript is browser, rather than server-side, unless you're
using it in a framework. [...]
Utter nonsense, STFW.
Hardly nonsense. Are you talking about a specific web server?
I am talking about the restrictions of the programming language(s)
that you are implying, and that simply do not exist.

I never said any restrictions exist.

"JavaScript is browser, rather than server-side"

Sounds familiar?

Yes it does. His JavaScript code was for communicating with the
client's browser. He therefore needed to do something on the server
side. That was indeed poorly worded, and this is why I clarified in
the follow posts.
Maybe so, but you said it completely wrong first.

Yes, I did. But, of course, that's not why you're attacking me.
Arguing with the silent majority already?

Nope, but why not accuse me of that, too? Oh wait, you did.
I hope for your sake that
you can do better than that.

Yes, I hope I can do better than what you accuse me of, too. I would
like to suggest the same for you (but actually for what you actually
do/say). Maybe you could be a better member of this newsgroup's
community while you're at it? Wishing thinking.

Nonsense.

No, but if you say it enough times, maybe you'll convince yourself?
Only you have been introducing the Apache argument without
an apparent need for it.

I only mentioned Apache because one could use a web service that could
run JS on the server side that wasn't the standard web service. I
never said one would need to use Apache at all.
So far we have only been talking about the
general use of the programming language,

You actually recognize and told the truth, for once. I think I have a
glimmer of hope.
and that does not exclude
server-side use at all, period.
Right.
[...]
there is a good chance it could even work with Apache as a module
or through the CGI mechanism, whereas the latter is more likely
than the former.

I said just that myself. I quote: "Try SSI, PHP, or something else
for server-side date and time." The "something else" could be any
number of things, from CGI, to RoR, to shell, to _anything_ at all.

Yes, the problem is that you placed it in a context where "anything"
would *not* include JavaScript,

I absolutely did no such thing. Again, if you keep claiming it, does it
make it true? I hope you don't believe that.
when that is obviously nonsense.

Yes, you are claiming things that are nonsense. Not only did I not
claim it, but you are using what you made up as a basis to argue about
it with me. That is freakishly weird of you to do.
And
now you are winding around that instead of simply admitting your
mistake.

I'm not going to admit a mistake I didn't make, just because your ego is
dictating your failure to admit your actual mistake. You continue to
claim that what I DID NOT say (what I omitted) is somehow a suggestion
that I meant something else. Even though I clarified, you simply now
say that I'm back tracking. Like I said, there's is no way to win with
you. You'd rather argue and accuse and use what you've wrongly accused
me of to argue further. It's crazy. I am not asking you to admit you
were wrong, even though you were. Now, you use your past assumptions
to continue to make claims that aren't true, so you can continue
arguing. Where does that sort logic get you? Nowhere.
That's not the point.

Yes, it is exactly the point. You are so afraid of being wrong about
it, that you've resorted to these tactics.
This is a technical newsgroup, and correct
terminology is of the utmost importance if a discussion is to be a
learning experience for everyone.

Yet it's utterly irrelevant to the issue. The term I used is exactly
correct. The fact I said page instead of document and acting like
that's relevant at all, is pathetic. Are you running out of better
things to argue about?
Yes, but in the wrong context.

No, not in the wrong context. Again, what you say doesn't actually make
things fact. You don't have the power to dictate what is fact or not
to suit your own personal whim. The fact you think so and operate that
way is disturbing.
I'm tired of explaining to you;

No, you're tired of not getting your way, and can't admit you're wrong
and I have the audacity to actually not admit to something you wrongly
accuse me of. Believe it or not, you're just not that important.
learn to read and write in a way
that the chances are low(er) that you misunderstand others and be
misunderstood by them.

I admitted I could have worded it better originally. Unlike you, I'm an
honest and reasonable person. The original post was worded poorly,
which is why I clarified. You just can't accept it and continue to act
like a maniac. You are very much well aware of what I had meant by
now, so you need to let it go. Seriously, just take a breath and
relax.
 
E

Evertjan.

Tim Greer wrote on 18 dec 2008 in comp.lang.javascript:
Good play... after all, if you just accuse me of what you're doing
(even if I'm not),

I am just responding on the "I can't reason with you at all (but that
wasn't anything you were willing to do from the start)"

How can that be circular?
then it's completely circular and you're never held to
what you say (just me held to what you claim I said). Like I said,
you can't be reasoned with.
I posted with a genuine intent of helping the OP with their question.

So noble. [Realy, I mean that, intent is 9/10 of an action]
I didn't come in here trolling or trying to cause problems. If
someone didn't agree or wanted to correct me or ask for clarification,
I'd be happy to do so. I'm not immune to being wrong or
misunderstanding a question.

You were wrong. It is irrelevant if you are immune to that, because posting
is done to the NG, not only to you.
I mean, what can someone say about this sort of reaction? I thought I
might have been confused with someone else at first, or who knows
what. This honestly doesn't make any sense. If I felt I was wrong,
I'd have no problem admitting it. I think it's just a matter of
miscommunication, in association with how aggressive you two have been
about the topic. I don't have a problem with you. Let's just move on.

I do not have a problem with you, just with your arguments that you were
right, and that Javascript is a browser only language.

All the arguments [Apache, framework, service, API, etc] do not change that
you were wrong in "JavaScript is browser, rather than server-side".

I am not expecting you to acknowledge that anymore, just move on would be
fine to me.
 
B

beegee

All the arguments [Apache, framework, service, API, etc] do not change that
you were wrong in "JavaScript is browser, rather than server-side".

I am not expecting you to acknowledge that anymore, just move on would be
fine to me.

C'mon you guys, you're being obstinate. Do you use javascript on the
server to deliver content to the client? It seems maybe Dr. Stockton
does but you're not being honest if you don't admit it is VERY rare.
I use jscript in utility scenarios and I'm interested in Titanium but
its disingenuous to make a big stinking point of Tim being wrong when
for all practical intents and purposes, he is not.

Bob
 
Y

Yonih

Thank you everyone for all your advice. I have decided to go with a
PHP
<?= date("l, F jS Y")?>
Which is almost working. Seem like the server that the code is on the
time and date are off by a couple hours so I am assuming its timezone
related so now ill have to look for away to manipulate it some how.
If anyone knows please feel free to give advice.
Thanks
Yoni
 
K

Kris Zyp

Just FYI, server-side JavaScript frameworks actually seem to be a
really growing in popularity because of the consistency of using the
same language on the client and server. In case you are curious about
such an approach, here is one (non-definitive) list of some available
JS servers [1]. I am the lead of one these [2], but there are a number
to choose from.
[1] http://en.wikipedia.org/wiki/Server-side_JavaScript
[2] http://www.persvr.org/
Thanks,
Kris

nly language.


All the arguments [Apache, framework, service, API, etc] do not change that
you were wrong in "JavaScript is browser, rather than server-side".
I am not expecting you to acknowledge that anymore, just move on would be
fine to me.

C'mon you guys, you're being obstinate.  Do you use javascript on the
server to deliver content to the client?  It seems maybe Dr. Stockton
does but you're not being honest if you don't admit it is VERY rare.
I use jscript in utility scenarios and I'm interested in Titanium but
its disingenuous to make a big stinking point of Tim being wrong when
for all practical intents and purposes, he is not.

Bob
 
Y

Yonih

Just FYI, server-side JavaScript frameworks actually seem to be a
really growing in popularity because of the consistency of using the
same language on the client and server. In case you are curious about
such an approach, here is one (non-definitive) list of some available
JS servers [1]. I am the lead of one these [2], but there are a number
to choose from.
[1]http://en.wikipedia.org/wiki/Server-side_JavaScript
[2]http://www.persvr.org/
Thanks,
Kris

nly language.
All the arguments [Apache, framework, service, API, etc] do not change that
you were wrong in "JavaScript is browser, rather than server-side".
I am not expecting you to acknowledge that anymore, just move on would be
fine to me.
C'mon you guys, you're being obstinate.  Do you use javascript on the
server to deliver content to the client?  It seems maybe Dr. Stockton
does but you're not being honest if you don't admit it is VERY rare.
I use jscript in utility scenarios and I'm interested in Titanium but
its disingenuous to make a big stinking point of Tim being wrong when
for all practical intents and purposes, he is not.
Bob- Hide quoted text -

- Show quoted text -

Thanks. For me though the whole site is done in PHP so it seems its
the best way to go. And I solved my Time zone problem for those who
would like to know the code here it is.

<? putenv("TZ=US/Eastern");echo date("l, F jS, Y")."";?>

Gives me the Date for EST.

Thanks all for your help
Yoni
 
H

Henry

On Dec 18, 5:19 am, "Evertjan." wrote:
All the arguments [Apache, framework, service, API, etc] do
not change that you were wrong in "JavaScript is browser,
rather than server-side".
I am not expecting you to acknowledge that anymore, just move
on would be fine to me.

C'mon you guys, you're being obstinate. Do you use javascript
on the server to deliver content to the client? It seems maybe
Dr. Stockton does but you're not being honest if you don't admit
it is VERY rare.

At the time .NET was introduced it was estimated that 20% of ASP
"Classic" pages had been scripted with JScript. ASP "Classic" as not
so rare that 20% of it would qualify as "VERY rare".
I use jscript in utility scenarios and I'm interested in
Titanium but its disingenuous to make a big stinking point
of Tim being wrong when for all practical intents and purposes,
he is not.

It is wrong to suggest (or even imply) that javascript is a browser
language. Various ECMAScript implementations are (and have been) used
for scripting other environments. It has been used in, for example,
ASP and WSH, Adobe acrobat, Flash and Photoshop, and there is a
mozilla.dev.tech.js-engine group that discusses imbedding Spidermonkey
and Rhino in any arbitrary application. Indeed, if you were going to
make an application scriptable employing an ECMAScript implementation
has lots of advantages; not having to invent your own language, being
able to employ pr-existing (commercial and open-source) JS engines,
reduced learning cost as users transfer skills acquired through web
development.
 
T

Tim Greer

Evertjan. said:
Tim Greer wrote on 18 dec 2008 in comp.lang.javascript:
Good play... after all, if you just accuse me of what you're doing
(even if I'm not),

I am just responding on the "I can't reason with you at all (but that
wasn't anything you were willing to do from the start)"

How can that be circular?
then it's completely circular and you're never held to
what you say (just me held to what you claim I said). Like I said,
you can't be reasoned with.
I posted with a genuine intent of helping the OP with their question.

So noble. [Realy, I mean that, intent is 9/10 of an action]
I didn't come in here trolling or trying to cause problems. If
someone didn't agree or wanted to correct me or ask for
clarification,
I'd be happy to do so. I'm not immune to being wrong or
misunderstanding a question.

You were wrong. It is irrelevant if you are immune to that, because
posting is done to the NG, not only to you.
I mean, what can someone say about this sort of reaction? I thought
I might have been confused with someone else at first, or who knows
what. This honestly doesn't make any sense. If I felt I was wrong,
I'd have no problem admitting it. I think it's just a matter of
miscommunication, in association with how aggressive you two have
been
about the topic. I don't have a problem with you. Let's just move
on.

I do not have a problem with you, just with your arguments that you
were right, and that Javascript is a browser only language.

All the arguments [Apache, framework, service, API, etc] do not change
that you were wrong in "JavaScript is browser, rather than
server-side".

I am not expecting you to acknowledge that anymore, just move on would
be fine to me.

This is silly. Javascript will work talking to the browser, in a
framework (what do you think JSP, ASP, etc. effectively is?), or have
it generated in a PHP, CGI, RoR or any other type of script or
language. Nothing was "wrong" about saying that, all because you THINK
I said that JS was "browser only", which I never did say. I clarified,
and you very well know (by now) what I said, and yet you would rather
argue and continue saying I am wrong. Simply say it was not worded
well or I could have elaborated more at first (which I could have and I
admit), rather than just acting immature about the whole thing.
 
T

Tim Greer

Henry said:
It is wrong to suggest (or even imply) that javascript is a browser
language.

That's the problem, no one suggested that. The confusion about it came
from the accusation and nothing more. Followup posts made that clear.
Obviously if I said it was only browser side, I'd not have mentioned
frameworks (which was only one of several options). I.e., ASP is a
framework to run JScript, VBScript, PerlScript, etc.) I even
apologized if my poorly worded reply caused any confusion, and my
followups clearly show what I said (I implied nothing simply because I
didn't elaborate). Of course, none of that arguing helped the user. I
think we can all move on now.
 
E

Evertjan.

beegee wrote on 18 dec 2008 in comp.lang.javascript:
All the arguments [Apache, framework, service, API, etc] do not
change that you were wrong in "JavaScript is browser, rather than
server-side".

I am not expecting you to acknowledge that anymore, just move on
would be fine to me.

C'mon you guys, you're being obstinate. Do you use javascript on the
server to deliver content to the client?

I certainly do.
It seems maybe Dr. Stockton
does but you're not being honest if you don't admit it is VERY rare.

That is not the point. And I would not call John very rare.

Serverside Jscript has some functions that are not available to VBS,
and it is just fun to use.

I often use a mix of jscript and vbs fuctions.
I use jscript in utility scenarios and I'm interested in Titanium but
its disingenuous to make a big stinking point of Tim being wrong when
for all practical intents and purposes, he is not.

No, he is wrong, and I was not the first to say so in this thread.
 
T

Tim Greer

Tim said:
(what do you think JSP, ASP, etc. effectively is?)

Before anyone calls me on that, I will correct myself. JSP for running
the code on serverside (not saying it is a framework) and ASP.NET being
the framework -- though that's not all it is (it's more than just a
framework) and that they "effectively accomplish". Being, running
Javascript code on the server-side (or you can use PHP, CGI, RoR (rails
being a framework as well) to use in conjunction with. I don't actually
like .NET at all, so for the record - I wasn't doing any marketing. I
was just listing some options... in fact to show that JavaScript is
_more_ than just talking to the browser. Hence, the opposite of what
some people were claiming I said or meant. I hope that is more clear.
This is what I get for posting while being too busy with other stuff.
 
T

Tim Greer

Tim said:
I.e., ASP is a
framework

Before anyone gets picky about that, I am clarifying to say ASP.NET
(framework). And, yes, it is more than a framework. Again, this was
nothing more than a suggestion of running Javascript code on the
server-side instead of only generating it or using it in conjunction
with PHP, a CGI script, RoR, SSI, or any number of things, which I also
had mentioned. Hence, the opposite of what some people were claiming I
said or meant. I hope that is more clear. So, no reason to debate
about assumptions, especially once they are clarified. Cheers!
 
T

Thomas 'PointedEars' Lahn

Yonih said:
Thank you everyone for all your advice. I have decided to go with a
PHP
<?= date("l, F jS Y")?>

<OT>

PHP's "short_open_tag 1" should not be used in a production environment
because that has drawbacks:

<http://php.net/ini.core>

For runtime efficiency, double quotes should not be used if there are no
variable references in the string that need to be expanded; single
quotes should be used instead:

<http://php.net/manual/en/language.types.string.php>

</OT>

Simple statements should be ended with a semicolon, in ECMAScript
implementations as in PHP. (In PHP a simple statement followed by
optional whitespace and another simple statement is a syntax error.)

<http://php.net/manual/en/language.basic-syntax.instruction-separation.php>


PointedEars
 
T

Tim Greer

Evertjan. said:
No, he is wrong,

If you have such trouble accepting the facts, go back and read the
thread from the start. I was not wrong. I never said what you accuse
me of saying. You have no intention of doing the right thing, because
you enjoy arguing.
 
E

Evertjan.

Tim Greer wrote on 18 dec 2008 in comp.lang.javascript:
That's the problem, no one suggested that.

You did, Tim.

Do I need to repeat your sentense for the umptieth time?
The confusion about it came
from the accusation

Accusation?
An accusation is is telling about a crime, you simply made a mistake.
and nothing more.

Trying to kill the messenger?
Followup posts made that clear.
Obviously if I said it was only browser side, I'd not have mentioned
frameworks (which was only one of several options). I.e., ASP is a
framework to run JScript, VBScript, PerlScript, etc.) I even
apologized if my poorly worded reply caused any confusion, and my
followups clearly show what I said (I implied nothing simply because I
didn't elaborate).

You constantly maintained you were right,
even implying that serverside ment only Apache to you.
Of course, none of that arguing helped the user. I
think we can all move on now.

What user?
The user is not interested in programming languages.
 
D

Dr J R Stockton

In comp.lang.javascript message <9e0890c8-f9cd-43d5-ae48-ff4808973bd2@u1
8g2000pro.googlegroups.com>, Thu, 18 Dec 2008 06:33:56, Yonih
Thank you everyone for all your advice. I have decided to go with a
PHP
<?= date("l, F jS Y")?>
Which is almost working. Seem like the server that the code is on the
time and date are off by a couple hours so I am assuming its timezone
related so now ill have to look for away to manipulate it some how.
If anyone knows please feel free to give advice.

When posting on matters associated with the actual date and time, you
should give your approximate location (sufficient to show your Winter
and Summer Time biases); and id applicable that of the server. And be
aware that if you give an @gmail address or post through Google or
similar with no contrary indication, people will think that you may be
American[*], and adjust their responses accordingly.

[*] Most Americans are either too ashamed of their country to
acknowledge their location, or too ignorant to believe that there is
more intelligent life outside the States than within it.
 
T

Tim Greer

Evertjan. said:
Tim Greer wrote on 18 dec 2008 in comp.lang.javascript:


You did, Tim.

No, I did not. You just _continue_ to claim I did, which doesn't
actually make it so. The thread speaks for itself, I clarified it and
admitted the wording was poor. I never said any of the things you
continue to accuse me of. You just like to argue. Have you nothing
better to do? You'd honestly rather keep posting false accusations to
suit your argument, fully knowing it's not true, all because you can't
accept what I actually said? The method you use to ignore what was
said and continue to argue, is sad. It's clear your intent is to troll
from the start.
 
T

Thomas 'PointedEars' Lahn

Yonih said:
Thanks. For me though the whole site is done in PHP so it seems its
the best way to go. And I solved my Time zone problem for those who
would like to know the code here it is.

<? putenv("TZ=US/Eastern");echo date("l, F jS, Y")."";?>

Gives me the Date for EST.

As for short_open_tag, see my previous posting
(<
putenv() is _not_ the proper way to set the default timezone. Your
script may not have enough privileges to set environment variables,
especially not in a production environment:

<http://php.net/putenv>
<http://php.net/date_default_timezone_set>

As for the double quotes, see my previous posting.

The first semicolon should be followed by whitespace, for good code
style (PEAR et al.)

Leading or trailing concatenation of the empty string is unnecessary,
inefficient nonsense.


X-Post & F'up2 comp.lang.php

PointedEars
 
T

Thomas 'PointedEars' Lahn

Tim said:
That's the problem, no one suggested that. The confusion about it came
from the accusation and nothing more. Followup posts made that clear.
Obviously if I said it was only browser side, I'd not have mentioned
frameworks (which was only one of several options).

One day maybe you will understand that a framework is not a requirement
for executing code server-side. Until that day comes you better accept
that your argument maybe was well-intentioned but seriously flawed --
and leave it at that.


PointedEars
 
T

Tim Greer

Thomas said:
One day maybe you will understand that a framework is not a
requirement
for executing code server-side.

Once again, I *never* said it was, though you keep repeating the
accusation. That's the problem with you, I've made it _very clear_
that I _do_ understand that a framework is not needed. You see, that's
_why_ I mentioned JSP, PHP, CGI, SSI. You can't get any clearer than
that.

You must have serious issues to keep arguing about this, considering
that it has been clarified to the point that even you must know by now
what I said and what I meant. Is this really how you want to operate
and impress upon people that you still can't get it?
Until that day comes you better
accept that your argument maybe was well-intentioned but seriously
flawed -- and leave it at that.

Does the term pot calling the kettle black mean anything to you? This
is sad.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top