Hello! I’ve been having some problems getting a document.write command working correctly. As a complete beginner in JavaScript I’m assuming it’s a syntax problem. Either that or I’m trying something really stupid.
My code currently has this line:
[CODE]document.write(‘<p><a target=”photo” href=’+'”‘+imagelinks[ry1]+'”‘+’><img src=”‘+myimages[ry1]+'” border=0></a></p>’)
Basically it prints the picture whose address is held in myimages[ry1] which is linked to the address in imagelinks[ry1]. When clicked, the link opens in a new window.
I want to edit this so that the window that opens is handled by JavaScript so I can get rid of the scrollbars etc. I can do this fine using Dreamweaver on a static image in HTML but am having trouble implementing this into this Javascript.
Here is my attempt (which doesn’t work!):
[CODE]function MM_openBrWindow(theURL,winName,features) {
window.open(theURL,winName,features);
}
[CODE]document.write(‘<p><a href=”#”><img src=”‘+myimages[ry1]+'” border=0 onClick=”MM_openBrWindow(‘+imagelinks[ry1]+’,’photo’,’width=300,height=300′)”></a></p>’)
Any ideas on how to correctly implement the “onClick=”MM_openBrWindow…” bit?
Thanks in advance,
T