PDA

View Full Version : pop up window from html text field



potamus
March 23rd, 2004, 02:48 PM
I've found lots of posts and tutorials on this general subject but nothing addressing this particular problem.

I want to support clickable images in my html text fields. The image thumbnails when clicked will open up a copy of themselves in a larger "new" window. I've done this in straight html b/f with no problems but i'm getting some interesting behavior when I try it from the flash html text fields.

a simplified example

the following html code lives in an external text file which is dynamically loaded into an html text field

please excuse the syntax errors, had to do it b/c the HTML Code is enabled and I couldn't figure out how to disable it.



anchor hreference="javaascript:window.open('http://www.google.com')"
image src="images/thumbnail.jpg"
/anchor





click on the image and the new window is created successfully, however, we lose the parent. The parent window displays

[object]

with

javaascript:window.open('http://www.google.com') shown in the location bar.


hmmmm, any insight much appreciated.

thanks

potamus

claudio
March 23rd, 2004, 03:20 PM
<a href="#" onMouseDown="javascript:window.open('http://www.google.com');"><img src="images/thumbnail.jpg"></img></a>

potamus
March 24th, 2004, 10:55 AM
claudio,

thanks for the response!, i think we're close? I tested the code and no new window opens. the only thing that happens is the # sign is appended to the url.

do i have to include something in the main html file to allow permissions for foreign client side scripts to be executed???

To ensure correct syntax I inserted the same code into a plain html file and it worked fine.

any ideas?

thanks!

potamus.

claudio
March 24th, 2004, 11:38 AM
Wait, are you using flash?
If so, try:
<a href="javascript:void(window.open('http://www.google.com'));"><img src="images/thumbnail.jpg"></img></a>

potamus
March 24th, 2004, 07:11 PM
thank you thank you! that did the trick!

potamus.

claudio
March 24th, 2004, 09:49 PM
Anytime ;)