I built a web page form, where the action is set to "mailto" to my email address. I already scripted the client side using Javascript and I wish to know if I can use Javascript for server side scripting as well?

I do not know PHP, nor Perl, and prefer not to learn another scripting language, simply, because I have not the time.

Thanks for any comment.
ineuw

Member Avatar for Dukane

I think JavaScript is a client side only language.

I built a web page form, where the action is set to "mailto" to my email address. I already scripted the client side using Javascript and I wish to know if I can use Javascript for server side scripting as well?

I do not know PHP, nor Perl, and prefer not to learn another scripting language, simply, because I have not the time.

Thanks for any comment.
ineuw

Yes, you can use JS server side. However, you'll probably be surprised that it may not handle like the client side JS since you are working with a different environment and model. Instead of an Event based model it would be just a Request/Response model (or whatever it would be called).

I haven't used it myself, but just guessing.

PHP is actually a very simple language. If you grasp JS, PHP should be easy with a good reference to use. It may be easier that server side JS.

Usually, its how the language is implemented that takes time to learn. PHP on the client side for instance is a pain since its totally object oriented, when there are better languages to handle that. PHP on the server side is simple since it is very good at manipulating xHTML as a string.

If I were to guess, JS on the server side would mean manipulating HTML as an Object. It would be quite tedious. JS does not handle strings as well as PHP also.

Just giving you some things to think bout. I'd say do your research well before committing to a language as it would save time later.

One disadvantage of JS on server side is that it isn't that popular, its would be harder to get help on it as well as implement it on a server.

Thanks for the responses. Since posting my inquiry, additional reading confirms everything digital-ether has touched upon.

Thanks again, and now . . . on to PHP

And if you still want to know a bit more about this thing, this blog post is does a good job of doing that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.