By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,649 Members | 2,154 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,649 IT Pros & Developers. It's quick & easy.

Javascript in a JSP/JSTL page

P: n/a
Hello.

I need insert a piece of javascript code in a JSTL page, that it will
execute always, that is, without events. I use the tag <scriptbut
this make that the web don't load correctly.
Any idea?

May 3 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Manuel <mf*****@gmail.comwrote:
>Hello.

I need insert a piece of javascript code in a JSTL page, that it will
execute always, that is, without events. I use the tag <scriptbut
this make that the web don't load correctly.
JSTL and JSP run on the server. The result is an HTML page which is
sent to the client. That page may contain Javascript, which will run
on the client.

Javascript that's not part of a function will run when it's
encountered. Something like this:

<script type="text/javascript">
var a;
a = 5;
alert ("a=" + 5);
</script>

will cause a message box to appear as soon as the browser parses it.

--
Tim Slattery
Sl********@bls.gov
http://members.cox.net/slatteryt
May 3 '07 #2

P: n/a
On May 3, 6:22 pm, Tim Slattery <Slatter...@bls.govwrote:
Manuel <mfc1...@gmail.comwrote:
Hello.
I need insert a piece of javascript code in a JSTL page, that it will
execute always, that is, without events. I use the tag <scriptbut
this make that the web don't load correctly.

JSTL and JSP run on the server. The result is an HTML page which is
sent to the client. That page may contain Javascript, which will run
on the client.

Javascript that's not part of a function will run when it's
encountered. Something like this:

<script type="text/javascript">
var a;
a = 5;
alert ("a=" + 5);
</script>

will cause a message box to appear as soon as the browser parses it.

--
Tim Slattery
Slatter...@bls.govhttp://members.cox.net/slatteryt
I know it. But that crash and the web is not loaded correctly and i
don't know why :(

May 3 '07 #3

P: n/a
Manuel <mf*****@gmail.comwrote:
>On May 3, 6:22 pm, Tim Slattery <Slatter...@bls.govwrote:
>Manuel <mfc1...@gmail.comwrote:
>Hello.
>I need insert a piece of javascript code in a JSTL page, that it will
execute always, that is, without events. I use the tag <scriptbut
this make that the web don't load correctly.

JSTL and JSP run on the server. The result is an HTML page which is
sent to the client. That page may contain Javascript, which will run
on the client.

Javascript that's not part of a function will run when it's
encountered. Something like this:

<script type="text/javascript">
var a;
a = 5;
alert ("a=" + 5);
</script>

will cause a message box to appear as soon as the browser parses it.

--
Tim Slattery
Slatter...@bls.govhttp://members.cox.net/slatteryt

I know it. But that crash and the web is not loaded correctly and i
don't know why :(
If the script refers to something that hasn't been loaded yet, it will
fail. Try moving your script block to the end of the HTML page.

--
Tim Slattery
Sl********@bls.gov
http://members.cox.net/slatteryt
May 3 '07 #4

P: n/a
On May 3, 10:07 pm, Tim Slattery <Slatter...@bls.govwrote:
Manuel <mfc1...@gmail.comwrote:
On May 3, 6:22 pm, Tim Slattery <Slatter...@bls.govwrote:
Manuel <mfc1...@gmail.comwrote:
Hello.
I need insert a piece of javascript code in a JSTL page, that it will
execute always, that is, without events. I use the tag <scriptbut
this make that the web don't load correctly.
JSTL and JSP run on the server. The result is an HTML page which is
sent to the client. That page may contain Javascript, which will run
on the client.
Javascript that's not part of a function will run when it's
encountered. Something like this:
<script type="text/javascript">
var a;
a = 5;
alert ("a=" + 5);
</script>
will cause a message box to appear as soon as the browser parses it.
--
Tim Slattery
Slatter...@bls.govhttp://members.cox.net/slatteryt
I know it. But that crash and the web is not loaded correctly and i
don't know why :(

If the script refers to something that hasn't been loaded yet, it will
fail. Try moving your script block to the end of the HTML page.

--
Tim Slattery
Slatter...@bls.govhttp://members.cox.net/slatteryt
well, I call a some function that it is at an external file that is
loaded in the beginning of the webpage. All the ways, I tried with a
simple code that this:

<script type="text/javascript">
alert("hello world");
</script>

I don't understand :(((

May 3 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.