Friday 25 July 2003 3:12:20 am
I know this is one of the good old problems and I have read
http://ezwiki.blanko.info/index.php/3XHT_EscapeLiteral http://www.ez.no/developer/ez_publish_3/documentation/customization/tips_tricks/javascript_in_templates and just about every forum message on the topic over and over again, so please excuse me for bringing this up again... I just can't make it work...! My initial plan is to implement a dhtml menu such as http://www.opencube.com/prod_quickmenupro.html in the pagelayout template, but that seems like a pretty ambitious project at the moment... So just to get an idea of how to use javascript in the templates, i have tried to create a simple rollover image.. but not even that will work! :-( This is what i have in the head of pagelayout_mydesign.tpl:
<head>
<link rel="stylesheet" type="text/css" href={"stylesheets/core.css"|ezdesign} />
<link rel="stylesheet" type="text/css" href={"stylesheets/mydesign.css"|ezdesign} />
<SCRIPT SRC={"javascripts/rollover.js"|ezdesign} TYPE="text/javascript" LANGUAGE="JavaScript"/> </head> __________________________ And here is the line in the body of pagelayout_mydesign.tpl that calls the rollover function: <A HREF="http://www.uni2.dk" TARGET="_blank" onMouseOver="return skiftBillede('uni2logogrey','billede2')" onMouseOut="return skiftBillede('uni2logogrey','billede1')"><IMG SRC={"uni2logogrey.gif"|ezimage} NAME="uni2logogrey" BORDER="0" HEIGHT="20" WIDTH="54" /></A> __________________________ "javascripts/rollover.js" looks like this: <SCRIPT TYPE="text/javascript" LANGUAGE="javascript">
if (document.images) {
billede1 = new Image(); billede1.src = "/design/mydesign/images/uni2logogrey.gif";
billede2 = new Image(); billede2.src = "/design/mydesign/images/uni2logo.gif"; }
function skiftBillede(Navn,Endelse) {
if (document.images) {
document [Navn].src = eval(Endelse + ".src");
} } </SCRIPT> __________________________
When I try to view my site in the browser I don't get any error messages.. and i don't get the content of my site either... :-( ...all I get is the background color of the site and nothing else... I have tried using {literal}, {ldelim} and {rdelim} tags as well, but either I'm not doing it right (which is very likely) or it just doesn't work (not so likely)... What am I doing wrong and what should I do instead?
Regards, Morten.
|