Adding custom javascript code |
11/8/2006 6:05:12 AM |
PHPRunner General questions | |
R
runey author
I just tried to enter some javascript code... Basically just added some code to change the image of a button when it is clicked... Normally I would just some code into the <head> like this <script language="JavaScript">
<a href="YOUR LINK" onmousedown="on('image1');" onmouseup="off('image1')"><img src="IMAGE FILE OFF" border="0" name="image1"></a><br>
|
|
![]() |
Alexey admin 11/8/2006 |
Hi, |
R
|
runey author 11/8/2006 |
I tested the javascript code in a blank html page, ie no code other than the javascript, and it works just fine... Smarty error: [in menu.htm line 21]: syntax error: unrecognized tag: document[name].src = eval(name + "on.src"); (Smarty_Compiler.class4.php, line 436) |
![]() |
Alexey admin 11/8/2006 |
I'm sorry, my fault. {literal} <script language="JavaScript"> <!-- Hide from old browsers var NN3 = false; image1= new Image(); ... function off(name) {if (NN3) off3(name);} // --> </script> {/literal} |
R
|
runey author 11/8/2006 |
Thanks for that <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=12647&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' /> I'll try it tonight... |
J
|
Jean 11/11/2006 |
I'm sorry, my fault. You can not use curly brackets - {} in your javascript code. Otherwise enclose the code in {literal} .. {/literal} block. [...]
|