budapestnori
Technical User
Here is the code I have. If I put nothing the onclick="enlarge()" event handler, the function enlarge is called. But the moment I try to put anything in there, esp. theimg[0], the enlarge function is not being called any longer. The only thing I could possibly see is that in the sting value of imghtml is this:
<a href="javascript:void(0)" onclick="enlarge("images/gallery/w.jpg"";>
<img style="margin-top:57px;" scr="images/gallery/w.jpg" border="0"></a>
Is there an issue with either the " or / character?
function returnimgcode(theimg,mtop){
var imghtml=""
var x=mtop
if (theimg[1]!=""
imghtml= '<a href="'+theimg[1]+'" onclick="enlarge("'+theimg[0]+'"";>'
imghtml+='<img style="margin-top:'+x+'px;" src="'+theimg[0]+'" border="'+imgborderwidth+'">'
if (theimg[1]!=""
imghtml+='</a>'
return imghtml
}
function enlarge(img){
alert(img);
return;
}
<a href="javascript:void(0)" onclick="enlarge("images/gallery/w.jpg"";>
<img style="margin-top:57px;" scr="images/gallery/w.jpg" border="0"></a>
Is there an issue with either the " or / character?
function returnimgcode(theimg,mtop){
var imghtml=""
var x=mtop
if (theimg[1]!=""
imghtml= '<a href="'+theimg[1]+'" onclick="enlarge("'+theimg[0]+'"";>'
imghtml+='<img style="margin-top:'+x+'px;" src="'+theimg[0]+'" border="'+imgborderwidth+'">'
if (theimg[1]!=""
imghtml+='</a>'
return imghtml
}
function enlarge(img){
alert(img);
return;
}