473,396 Members | 2,113 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,396 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 6915
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.