Thursday 10 June 2004 2:29:55 am
Hello again Balaji. I have replied to the posting you made earlier. And as I was about to reply to this I saw that you had edited your original post as an answer to Paul's reply. While this probably might be convenient for you, it does mess a bit with the concept of threads and makes it harder for other people than Paul to chip in with some comments. Just my advice :-) Anyway, as far as I can see from the provided Javascript when this is run in a browser, the final value of the cTemp variable is: "<TD><IMG SRC=/images/_03.jpg WIDTH=155 HEIGHT=107></TD>
<TD><IMG SRC=/images/_04.jpg WIDTH=155 HEIGHT=107></TD>
<TD><IMG SRC=/images/_05.jpg WIDTH=155 HEIGHT=107></TD>
<TD><IMG SRC=/images/_06.jpg WIDTH=155 HEIGHT=107></TD>"
First of all I would like to point out that the attribute values in the IMG tag lacks " or ' around their values. Now I don't now which version of HTML you're using but I do believe that you should put the attribute values in either " or ' to be sure that most browsers can view your HTML. When it comes to the problem of how to use JavaScript inside an eZ template there's two ways. First is to use {literal}{/literal} to make eZ write the { and } characters between those "tags" correctly, or you could write "{ldelim}" instead of "{" and "{rdelim}" instead of "}" in all your Javascripts. So to put your Javascript inside an eZ template, here's what I would do:
<script type="text/javascript" language="Javascript">
{literal}
function fnBuildTopMenu(cIn)
{
var cTemp = "";
cTemp = cTemp + "<TD><IMG SRC="{/literal}{_03.jpg|ezimage}{literal}" WIDTH=155 HEIGHT=107></TD>";
cTemp = cTemp + "<TD><IMG SRC="{/literal}{_04.jpg|ezimage}{literal}" WIDTH=155 HEIGHT=107></TD>";
cTemp = cTemp + "<TD><IMG SRC="{/literal}{_05.jpg|ezimage}{literal}" WIDTH=154 HEIGHT=107></TD>";
cTemp = cTemp + "<TD><IMG SRC="{/literal}{_06.jpg|ezimage}{literal}" WIDTH=155 HEIGHT=107></TD>";
}
{/literal}
This uses the ezimnage template operator to insert the design/yoursiteaccess/images to path to all your image names. This would also put " around the source attribute of your img tag, if you still can't see any images then it's probably the resulting image source that is wrong and you should update your javascript to make sure it puts the correct image name in the src attribute.
best regards trondåge
trondåge
|