best scripting language for use with (x)html?

J

John Salerno

Pardon my ignorance, but whenever I think of JavaScript I can't help but
think of it as being something that's old and slowing going out of
style. Is this unfounded? Is JS still the main scripting language used
in web pages, or are others preferred? I know PHP and/or ASP.NET is
popular, but do they do the same things?

Thanks, and sorry that my question isn't exactly HTML-centric, but I
figured since I'm learning HTML/CSS right now, I only want to ask this
question in a group that focuses on those languages, and not a
full-blown scripting group, which would be over my head.
 
D

David Dorward

John said:
Pardon my ignorance, but whenever I think of JavaScript I can't help but
think of it as being something that's old and slowing going out of
style. Is this unfounded?

For client side? Yes.
Is JS still the main scripting language used
in web pages, or are others preferred?

For client side, the only other options are VBScript (IE only[1]) and
PerlScript (IE with a third party plugin only[2]).
I know PHP and/or ASP.NET is
popular, but do they do the same things?

No.

Server side scripting does /useful/ things. Client side scripting can be
used to duplicate server side scripting as a convenience for the user (but
you need the server side as client side isn't dependable), and for adding
other convenience features (such as highlighting a specific part of a
document when linked to[3])

[1] So a very bad choice[3]

[2] So an amazingly bad choice[3]

[3] An exception /might/ be for use on an intranet ... but dependence on IE
for web apps crippled IBMs attempt to switch to Linux desktops, so its
still not a very good idea.

[4] http://dorward.me.uk/software/frag/
 
M

Mark Parnell

Deciding to do something for the good of humanity, John Salerno
Pardon my ignorance, but whenever I think of JavaScript I can't help but
think of it as being something that's old and slowing going out of
style. Is this unfounded?

Well, old depends on your definition. Going out of style is probably a
matter of opinion - it's the most common (and best supported)
client-side scripting language; though as with any client-side scripting
you need to make sure your site still functions without it.
Is JS still the main scripting language used
in web pages, or are others preferred?

See above.
I know PHP and/or ASP.NET is
popular, but do they do the same things?

No. PHP and ASP are server-side. This means that they are processed on
the server, and the user just sees the end result.
Thanks, and sorry that my question isn't exactly HTML-centric, but I
figured since I'm learning HTML/CSS right now, I only want to ask this
question in a group that focuses on those languages, and not a
full-blown scripting group, which would be over my head.

That's fine - as the FAQ says, anything web-related is on topic here.
 
M

Michael Winter

Pardon my ignorance, but whenever I think of JavaScript I can't help
but think of it as being something that's old and slowing going out
of style. Is this unfounded?
Yes.

Is JS still the main scripting language used in web pages, or are
others preferred?

ECMAScript derivatives, like JavaScript and JScript, are the only
client-side scripting languages commonly implemented (though not
universally and can be disabled). IE also implements VBScript, but that
fact is best left forgotten.
I know PHP and/or ASP.NET is popular, but do they do the same things?

They are primarily used to process HTTP requests (PHP can also be used
for other things), so no, they don't.

[snip]

Mike
 
A

Andy Dingley

Pardon my ignorance, but whenever I think of JavaScript I can't help but
think of it as being something that's old and slowing going out of
style. Is this unfounded?

Yes, totally.

The only game in town for client-side scripting is JavaScript, and will
be for the forseeable future. Read the excellent book "Ajax in Action"
for a look at the current state of the art.

For server-side scripting, J(ava)Script is still the best choice for
ASP/Windows (don't use VBScript). PHP is popular because it's cheap and
easy to get hosting for. Java is probably the most powerful option.
The many other options are a long way behind these "big three" in
usefulness.
 
C

cwdjrxyz

John said:
Pardon my ignorance, but whenever I think of JavaScript I can't help but
think of it as being something that's old and slowing going out of
style. Is this unfounded? Is JS still the main scripting language used
in web pages, or are others preferred? I know PHP and/or ASP.NET is
popular, but do they do the same things?

Thanks, and sorry that my question isn't exactly HTML-centric, but I
figured since I'm learning HTML/CSS right now, I only want to ask this
question in a group that focuses on those languages, and not a
full-blown scripting group, which would be over my head.

The several other responses that you received appear correct.

Javascript and close relatives have been around quite a while. Back
during the browser war era they could be a royal pain to write to work
on most browsers. You sometimes had to write 3 different paths for IE4
type browsers, Netscape 4 browsers, and then Netscape 6 browsers. For
example one path might use document.all, another document.layers, and
the third document.getElementById. Fortunately most of the browsers of
this era are now history, and you usually can get along with standard
script for new pages now. You will still see a few older scripts with
all 3 paths around. The browser wars have faded quite a bit, and have
been replaced by a much larger monster - the media format wars.

Although javascript on the client side and various languages on the
server side can often be made to do the same things, this is not always
the case. The server can not know everything a browser can do and what
all of the settings for it are, so scripts involving some things have
to be done on the browser after the download from the server is
complete.

There are many languages you can use on the server if you have full
access to it and know how to use the various languages. Using PHP
perhaps is most easy for people coming from a PC background, and Perl
has many applications. JAVA takes a little more time to learn, but it
can be very powerful for many applications. Also popular computing
languages such as C++, Fortran, and several others have been used on
the server side. These require rather extensive libraries of code to be
installed on the server. As one example, there are very elaborate
programs for math calculations that you can buy for a very high price
and put on your computer. However some of these have versions written
in higher level languages to be put on a server. That would allow
anyone visiting your site to use the math program. I suspect that if
you have to ask the price for these server side math programs, you
likely can not afford them. Another thing to consider is that extensive
server side programs can sometimes use a high percentage of the server
resources. That is your problem if you own the server. However if you
rent server space from a host that allows server side programs, you had
best look at the fine print in your agreement with the host. Mine says
than any user can not use over a certain percentage of the computer
resources at any time. If you do, you will be shut down until you
correct the problem, get a large bill, or both.

Some applications of javascript, such as DHTML used to move things
around, do not seem to be used as much now as a few years. I suspect
that many now find making a flash movie a quicker and more powerful way
to make those ads with much action.
 
J

John Salerno

John said:
Pardon my ignorance, but whenever I think of JavaScript I can't help but
think of it as being something that's old and slowing going out of
style. Is this unfounded? Is JS still the main scripting language used
in web pages, or are others preferred? I know PHP and/or ASP.NET is
popular, but do they do the same things?

Thanks, and sorry that my question isn't exactly HTML-centric, but I
figured since I'm learning HTML/CSS right now, I only want to ask this
question in a group that focuses on those languages, and not a
full-blown scripting group, which would be over my head.

Thanks for the great responses. Definitely some good stuff to think about.

I should also mention that one thing that prompts my question is that I
was viewing the source info for random websites, and I noticed that
every page I happened to look at that had a banner at the top (or some
type of consistent design that appeared on all pages) used JavaScript to
create this. I had read elsewhere that PHP was good for this sort of
thing, so that's why I asked if they can do the same stuff. I understand
what it means for a scripting language to be client-side or server-side,
but I guess I don't get why you'd prefer one over the other.

Right now I'm sort of learning C# for fun, but I haven't begun anything
with ASP.NET yet. But I figure if I ever want to add scripting to my
websites, I would like to stick with C# and ASP.NET, as opposed to PHP
or JavaScript or whatever else is available. I understand that PHP and
ASP.NET can do mostly the same things, so another way to ask my question
would be something like, If I learn ASP.NET (or PHP), is there any
reason to use JavaScript also?
 
M

Mark Parnell

Deciding to do something for the good of humanity, John Salerno
I understand
what it means for a scripting language to be client-side or server-side,
but I guess I don't get why you'd prefer one over the other.

Server-side:
* Requires support on the server
* Is completely transparent to the end user

Client-side:
* Requires support in the user's browser (can be disabled)
* More immediate response (no connection back to the server)

AJAX basically combines the 2. :)
If I learn ASP.NET (or PHP), is there any
reason to use JavaScript also?

The two serve different purposes. IMHO, server-side is more important,
but client-side *can* be useful, as long as the site doesn't rely on it,
as it can easily be disabled by the end user.
 
J

John Salerno

Mark said:
Deciding to do something for the good of humanity, John Salerno


Server-side:
* Requires support on the server
* Is completely transparent to the end user

Client-side:
* Requires support in the user's browser (can be disabled)
* More immediate response (no connection back to the server)

AJAX basically combines the 2. :)


The two serve different purposes. IMHO, server-side is more important,
but client-side *can* be useful, as long as the site doesn't rely on it,
as it can easily be disabled by the end user.

That makes some sense to me now. I guess I should look into AJAX before
I go crazy learning something new, but for now I think I'll leave
JavaScript alone. Learning HTML and CSS is fun enough for now! :)
 
D

David Dorward

Andy said:
The many other options are a long way behind these "big three" in
usefulness.

Rubbish. There are plenty of other good options out there. Perl, Ruby and
Python spring to mind as three very powerful and popular options.
 
A

Andy Dingley

Rubbish. There are plenty of other good options out there. Perl, Ruby and
Python spring to mind as three very powerful and popular options.

Those are clearly the three next-closest candidates, but I don't think
they quite cut it.

Perl is a dog. mod_perl is bad enough, but I'd hate anyone to read an
old book and still think that CGI Perl was a sensible option for new
projects.

Python is a lovely language. Now find cheap (PHP-grade) hosting for it,
or build a real _big_ site with it.

Ruby / Rails is a close contender for Java and I think it might very
soon be a credible option. Not quite today though.

The advantage of Java over Python or Ruby isn't the language, or even
the core platform, it's in the _community_. Think of a need for a web
toolkit to do <foo> and Java already has a good, stable, free open
source one out there already. From Eclipse through to log4j, this stuff
is just sitting there waiting for you to be ready to use it. ASP will
never do that. Perl did it, but the language is too nasty. PHP did it,
but they were written badly by half-competent coders.
 
T

Toby Inkster

John said:
Is JS still the main scripting language used in web pages, or are
others preferred? I know PHP and/or ASP.NET is popular, but do they do
the same things?

That's like asking, "which are better: Apples or Potatoes?" Potatoes are a
terrible choice for picking up out of a fruit bowl and munching on; but
apples are an equally bad choice for roasting and serving covered with
gravy.

Javascript is (primarily) a client-side language (though there are
server-side Javascript technologies available). It is useful for
dynamically changing parts of a web page: hiding and showing stuff
depending on user actions, changing colours of things and so on. However,
users have the ability to disable Javascript, so you can't rely on it.

Server-side technologies like PHP or ASP.NET run on your server. They are
good for accessing, manipulating and formatting data on the server to be
sent to the browser, for important calculations (calculating the total
cost of a shopping cart) and so on. They run on the server, so can't be
disabled by the client.
 
A

Alan J. Flavell

Matter of opinion. I love it.

Some people love dogs. I'm more of a cat person myself, but
I've made a lot of use of Perl, both on and off the WWW.

But script in whatever you're comfortable with. Before I met Perl
(would have been about a decade back, I reckon) it was REXX. Ho hum.
 
J

John Salerno

Mark said:
Server-side:
* Requires support on the server
* Is completely transparent to the end user

Client-side:
* Requires support in the user's browser (can be disabled)
* More immediate response (no connection back to the server)

AJAX basically combines the 2. :)

Is AJAX something that will replace JavaScript, or does it still use
JavaScript as it is now?
 
D

David Segall

John Salerno said:
Is AJAX something that will replace JavaScript, or does it still use
JavaScript as it is now?
It uses JavaScript. Its even the central part of the name -
"Asynchronous JavaScript and XML".
 
J

John Salerno

David said:
It uses JavaScript. Its even the central part of the name -
"Asynchronous JavaScript and XML".

I just wasn't sure if it was maybe a different version of it, or an
evolution of it.
 
M

Mark Parnell

Deciding to do something for the good of humanity, John Salerno
<[email protected]> declared in alt.html:

[AJAX vs. JavaScript]
I just wasn't sure if it was maybe a different version of it, or an
evolution of it.

No, just a different use of it.
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top