Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Including JavaScript into a JSP Page

843836May 23 2005 — edited Dec 11 2007
Hi,
How do i include a piece of JavaScript <SCRIPT> stuff into a JSP Page?
Right now i have an HTML Page that includes some <SCRIPT> code. Now many other HTML files use this piece of <SCRIPT> stuff. How do i remove it , put it in one place(I mean where to put it and what would that file be called) and in a JSP page call this <SCRIPT> code?
Please help . i'm pretty new to JSP and JavaScript.
Thanks in Advance.
Phani

/**** CODE


<SCRIPT language=javascript>
<!--
if ((document.images) && ("Netscape" != navigator.appName) && (navigator.appVersion.indexOf('Mac') == -1))
document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/1.css\">");
else if ((document.images) && ("Netscape" != navigator.appName) && (navigator.appVersion.indexOf('Mac') > 1))
document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/5.css\">");
else if (("Netscape" == navigator.appName) && (parseInt(navigator.appVersion) == 4) && (navigator.appVersion.indexOf('Mac') == -1))
document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/2.css\">");
else if (("Netscape" == navigator.appName) && (parseInt(navigator.appVersion) == 4) && (navigator.appVersion.indexOf('Mac') > 1))
document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/3.css\">");
else if (("Netscape" != navigator.appName) && ("Microsoft Internet Explorer" != navigator.appName))
document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/6.css\">");
// -->
</SCRIPT>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 8 2008
Added on May 23 2005
9 comments
4,782 views