PDA

View Full Version : Javascript pop up window code not working...


jaelle
08-01-2006, 12:56 PM
I am using the following code to create a popup from a link:

<a href="javascript:window.open('slideshow_open.php?id=http ://www.heartofamericasuperstore.com/images/listing_pics/B8q9xveRtJ_forced_jpg_large.jpg','Slideshow','widt h=333,height=323')">Test Link</a>

For some reason it opens the popup window as well as taking the current page to a blank page w/ the word [object Window] on it. Does anyone have an idea as to how to keep this from happening and still be calling the javascript in the href attribute? (I am eventually going to be calling it from a getURL() in flash...

aldomatic
08-01-2006, 01:28 PM
try onclick="" rather then -> href=""

jaelle
08-02-2006, 12:43 PM
Yea that works, but how do i use onClick in Flash? My flash version of the link looks like:


largepopup_url.onRelease = function() {
javascriptURL = "javascript:window.open('slideshow_open.php?id=" + myVars["large" + i] + "','Slideshow','width=" + (myVars["large" + (i-1) + "_width"] - (-30)) + ",height=" + (myVars["large" + (i-1) + "_height"] - (-100)) + "')";
getURL(javascriptURL);
}

aldomatic
08-02-2006, 01:27 PM
you dont use onclick(is an evenHandler for javascript) within flash, you use onRelease, or onPress.
then that calls the getURL method

-al

jaelle
08-02-2006, 03:18 PM
That is what I am doing...

So, I need to figure out how to be able to call the javascript as a link

Ex: javascript:window.open('slideshow_open.php?id=http ://www.heartofamericasuperstore.com/images/listing_pics/B8q9xveRtJ_forced_jpg_large.jpg','Slideshow','widt h=333,height=323') so i can put it into the getURL function in Flash. And I want to be able to do that, or something like that without getting the [object Window] problem.