[opencms-dev] JavaScript in v5

Ronald Schouten rschouten at abebooks.com
Tue May 17 22:27:20 CEST 2005


It the JavaScript works on the HTML file and not the OpenCms page, make sure
that the OpenCms page does not have a different DTD tag. A valid DTD tag has
been the source of many a JavaScript not working in one file but working fine
in another.

Ron

-----Original Message-----
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Corbey, Clayton
Sent: Tuesday, May 17, 2005 1:16 PM
To: The OpenCms mailing list
Subject: RE: [opencms-dev] JavaScript in v5

Erik,

I am doing the same thing but with favourable results... 

I've included my simple JavaScript inside my main template. Here's the
code (all in the same file).

<head>

			<script language="JavaScript">
				tab0 = new Image();
				tab0.src =
"<cms:link>/system/galleries/pics/brandonrha_gallery/tab_about_over.jpg<
/cms:link>";

				tab1 = new Image();
				tab1.src =
"<cms:link>/system/galleries/pics/brandonrha_gallery/tab_news_over.jpg</
cms:link>";

				tab2 = new Image();
				tab2.src =
"<cms:link>/system/galleries/pics/brandonrha_gallery/tab_guest_over.jpg<
/cms:link>";

				tab3 = new Image();
				tab3.src =
"<cms:link>/system/galleries/pics/brandonrha_gallery/tab_services_over.j
pg</cms:link>";

				tab4 = new Image();
				tab4.src =
"<cms:link>/system/galleries/pics/brandonrha_gallery/tab_careers_over.jp
g</cms:link>";
			</script>
</head>

The next part is in the body...

				<a href="<cms:link>/about/</cms:link>" 
	
onmouseover="tab0.src='<cms:link>/system/galleries/pics/brandonrha_galle
ry/tab_about_over.jpg</cms:link>';"
	
onmouseout="tab0.src='<cms:link>/system/galleries/pics/brandonrha_galler
y/tab_about.jpg</cms:link>';">
				<img name="tab0"
src="<cms:link>/system/galleries/pics/brandonrha_gallery/tab_about.jpg</
cms:link>" border="0">
				</a>
				<a href="<cms:link>/news/</cms:link>" 
	
onmouseover="tab1.src='<cms:link>/system/galleries/pics/brandonrha_galle
ry/tab_news_over.jpg</cms:link>';"
	
onmouseout="tab1.src='<cms:link>/system/galleries/pics/brandonrha_galler
y/tab_news.jpg</cms:link>';">
				<img name="tab1"
src="<cms:link>/system/galleries/pics/brandonrha_gallery/tab_news.jpg</c
ms:link>" border="0">
				</a>
				<a href="<cms:link>/info/</cms:link>" 
	
onmouseover="tab2.src='<cms:link>/system/galleries/pics/brandonrha_galle
ry/tab_guest_over.jpg</cms:link>';"
	
onmouseout="tab2.src='<cms:link>/system/galleries/pics/brandonrha_galler
y/tab_guest.jpg</cms:link>';">
				<img name="tab2"
src="<cms:link>/system/galleries/pics/brandonrha_gallery/tab_guest.jpg</
cms:link>" border="0">
				</a>
				<a
href="<cms:link>/services/</cms:link>" 
	
onmouseover="tab3.src='<cms:link>/system/galleries/pics/brandonrha_galle
ry/tab_services_over.jpg</cms:link>';"
	
onmouseout="tab3.src='<cms:link>/system/galleries/pics/brandonrha_galler
y/tab_services.jpg</cms:link>';">
				<img name="tab3"
src="<cms:link>/system/galleries/pics/brandonrha_gallery/tab_services.jp
g</cms:link>" border="0">
				</a>
				<a href="<cms:link>/careers/</cms:link>"

	
onmouseover="tab4.src='<cms:link>/system/galleries/pics/brandonrha_galle
ry/tab_careers_over.jpg</cms:link>';"
	
onmouseout="tab4.src='<cms:link>/system/galleries/pics/brandonrha_galler
y/tab_careers.jpg</cms:link>';">
				<img name="tab4"
src="<cms:link>/system/galleries/pics/brandonrha_gallery/tab_careers.jpg
</cms:link>" border="0">
				</a>

Mine works great. The filename is called brandonrha.jsp. It is a
template, so I am not sure if that would make any difference when it
comes to functioning properly or not.

-Clayton

-----Original Message-----
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Erik Lyons
Sent: Tuesday, May 17, 2005 15:07
To: opencms-dev at opencms.org
Subject: [opencms-dev] JavaScript in v5

I'm trying to incorporate some JavaScript popup menus in a JSP template.
The code lives in a separate .js file accessed via a <cms:link> tag the
same as the style sheets, in the same ../resources folder. There is no
tomcat error loading the JSP and there is no client JS error from the
mouseovers, they just don't do anything. I've also tried dropping all
the JS code right in the JSP, instead of using <script
src=<cms:link>..., same result. This code works fine in a local HTML
file, so the only difference is that it is in a JSP served by OpenCMS.
Anyone else doing this sort of thing? 

Thanks,
-e.l.


_______________________________________________
This mail is send to you from the opencms-dev mailing list To change
your list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev



CONFIDENTIALITY NOTICE:  This message is intended only for the use of the
individual or entity to which it is addressed and may contain information
that is privileged, confidential and exempt from disclosure under applicable
law.  If the reader of this message is not the intended recipient you are
hereby notified that any distribution, copying, disclosure and use of, or
reliance on the contents of this transmission is strictly prohibited.  If you
have received this transmission in error, please notify us immediately by
return e-mail and destroy the transmission by deleting the original message,
attachments and all copies.17/5/2005



_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev



More information about the opencms-dev mailing list