What's wrong with my javascript?

Hi there!

I have a categorized view and in that view I have a column that contains an image. When the users click the image, I want it to open up that particular document in a pop-up window. Here’s my code:

“<img height=15 width=15 border=0 src='/” + @ReplaceSubstring (@Subset (@DbName; -1); “\” : " "; “/” : “+”) + “/edit.gif?OpenImageResource’ onclick=javascript:window.open('0/” + @Text(@DocumentUniqueID) + “?OpenDocument’,null,‘toolbars=0, scrollbars=0, location=0, statusbars=0, menubars=0, resizable=0, width=450, height=400, left = 287, top = 134’)>”

Of course, in my actual code, there are square brackets after the initial double quote and before the last double quote.

I can’t see what I’m doing wrong.

Can anyone please help?

Thanks!

Gérald

Subject: What’s wrong with my javascript?

I might be wrong, but don’t you need to wrap a around the img tag?

“<a href=”" onclick=javascript:window.open(‘0/" + @Text(@DocumentUniqueID) + "?OpenDocument’,null,‘toolbars=0, scrollbars=0, location=0, statusbars=0, menubars=0, resizable=0, width=450, height=400, left = 287, top = 134’)>"

Subject: *No, he is programming the onclick event of the image, no need for a anchor link

Subject: RE: *No, he is programming the onclick event of the image, no need for a anchor link

I don’t believe supports the onClick event. So you would have to wrap it in .

Syntax

<IMG

SRC=“location”

LOWSRC=“location”

ALT=“alterntiveText”

ALIGN=“alignment”

BORDER=“borderWidth”

HEIGHT=“height”

WIDTH=“width”

HSPACE=“horizMargin”

VSPACE=“verticalMargin”

ISMAP

USEMAP=“#mapName”

NAME=“imageName”

ONABORT=“imgLoadJScode”

ONERROR=“errorJScode”

ONLOAD=“imgLoadJScode”

SUPPRESS=“suppressOrNot”