Forum Moderators: open

Message Too Old, No Replies

Onclick will not show javascript in seperate layer

changing javascript in layer with onclick

         

syka786

6:37 pm on Feb 3, 2006 (gmt 0)

10+ Year Member



I need some help as Im new to javascript. I am using Dreamweaver 8 and I would like a option that when a thumbnail is clicked on the layerMAIN changed to contain the javascript information. Below is my code created by dreamweaver. What am I doing wrong. Is this possible what im trying to do?

<img src="http:www.examplesite.com/myIMG.JPG" name="myIMG" width="50" height="45" id="myIMG" onclick="MM_setTextOfLayer('LayerMain','','<script language="JavaScript" src="http://examplesite.com/ws/mywebsiteISAPI.dll?EKServer&ai=0%7E%7Eyxx%7B%7E&bdrcolor=FF9900&tlecolor=FFCE63&tlefs=0&tlfcolor=000000&track=&watchcat=550&width=570"></script>')"','DIV')" />

Thanks for any help

Tahir

DrDoc

6:41 pm on Feb 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The problem is that your code (the <script> stuff you're passing) breaks the JS parser.
You will need to edit the MM_setTextOfLayer function in your JavaScript.

syka786

6:47 pm on Feb 3, 2006 (gmt 0)

10+ Year Member



what do you mean by editing it. do I need to change the MM_setTextOfLayer and use something else?

DrDoc

6:59 pm on Feb 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Somewhere on your page you have a MM_setTextOfLayer function. E.g.:

<script type="text/javascript">
...
function MM_setTextOfLayer() {
...
}
...
</script>

What's inside the MM_setTextOfLayer function may need to be edited.

syka786

7:20 pm on Feb 3, 2006 (gmt 0)

10+ Year Member



This is what the function is do you know what may be wrong with it?

function MM_setTextOfLayer(objName,x,newText) { //v4.01
if ((obj=MM_findObj(objName))!=null) with (obj)
if (document.layers) {document.write(unescape(newText)); document.close();}
else innerHTML = unescape(newText);