473,811 Members | 2,565 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6941
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
2313
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. <!DOCTYPE CustomerLoopService SYSTEM "AAA.dtd"> How could I switch off the the loading and validating of the DTD when using jstl tag <x:parse> ?
0
1430
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
2713
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 have seen thus far find static values Here is an example of the oracle tags (but I will switch to jstl in the future) this example for for illustrative purposes
2
2988
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
1046
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
2079
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 absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
2
2739
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
1146
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 uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <c:if test="${param.sayHello}"> <!-- Let's welcome the user ${param.name} --> Hello ${param.name}!
5
8808
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 the home-page of the website developed using infoglue, the component should be able to generate links to all the pages in the website irrespective of the page's depth. I can generate it using the <structure:childPages> tag in infoglue-structure...
0
9605
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10393
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10136
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9208
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6893
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5697
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4342
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3020
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.