473,387 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Javascript in a JSP/JSTL page

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
4 6914
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Michael Alers | last post by:
Hello, I am extracting XML from a dbase and using jstl xml tag library to parse and display the xml. The problem I have is that the XML contains a DOCTYPE with a relative DTD declaration eg. ...
0
by: SOAP | last post by:
where are I fing JSTL documents and API? I am new to use JSTL in JSP Thank you.. -- ~ Samba, more than a low cost File and Printer server ~ -- Let us OpenSource --
1
by: Brent Eamer | last post by:
How do I assign a form field to a value parameter of the sql tag? Ie) I want a query that will search for an item in the database based on the value of a hidden form field All the examples I...
2
by: steve | last post by:
Has anyone converted a JSP app with JSTL to C#? Microsoft's converter (JLCA) seems to basically ignore JSTL tags. Any help would be appreciated. thanks - - steve
0
dmjpro
by: dmjpro | last post by:
Today I start learning JSTL. But I found in JSTL syntax that uri. Why it is? plz explain experts. Kind regards, Dmjpro.
1
dmjpro
by: dmjpro | last post by:
I added this line in JSP page. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> When I compile the JSP then i getting an error. org.apache.jasper.JasperException: The...
2
dmjpro
by: dmjpro | last post by:
look at my code ...... <jsp:usebean id = "test" scope = "page" class="java.lang.String"/> <c:if test = "test.length()==0"> <H1>Welcome JSTL</h1> <!--This portion is not executed--> </c:if>
0
by: mattmao | last post by:
Hello everyone, I've done some searching on google but still cannot find the proper solution. I want to use the JSTL core lib for my web application, say: <%@taglib...
5
by: cwinay | last post by:
Hi, I'm a novice in JSTL and Infoglue. Could anyone please let me know how I can generate a Sitemap component using these two? I need the component to have just one property ie the HomePage. Given...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.