In article <ce*******************@news.demon.co.uk>,
"Richard Cornford" <Ri*****@litotes.demon.co.uk> wrote:
+'<div ><a href="#" onclick="javascript:return Suite('+param+');">
<IMG src="tg.gif" ></a></div>'
I am not sure what the poster implied by:
return Suite('+param+')
We can assume the OP wants to call Suite. The use of + in this context
is curious. It reminds me of the syntax used in alerts as:
alert("parm = " + parm + ".");
The complete line was:
onclick="javascript
:return Suite('+param+');"
This says you want to pass the string "+parma+" to Suite.
The translation does include the words:
parameter the contents of "param"
This says the OP want to pass the variable parma to Suite.
onclick="javascript
:return Suite(param);"
To clarify, onclick specifies a character string of javascript code.
What means you use normal javascript syntax in the string. The only
problem is the of quote. The string ends with the second occurrence of
whatever type of quote you started the string.
To pass the variable parma to the function Suite, you need to just do:
onclick="return Suite(param);"
It assume you have declared the global variable param somewhere else as
in:
<script>
var param = 5;
</script>
....
<body>
....
<div ><a href="#" onclick="return Suite(param);">
<IMG src="tg.gif" ></a></div>
....
</body>
The point here is that param has no special meaning in the context of he
<a> tag as this does.
There is also the curious +' at the beginning of the line that may
indicate that the code is coming out of a document.write or something.
Which is why Richard mentioned the escaping, I assume. He assume you
wanted to get the variable when you did the assumed document write.
I assume you know returning false will stop the link.
If this doesn't help, we need more information.
Robert