/    Sign up×
Community /Pin to ProfileBookmark

createPopup help [it won’t stay open!!!]

I am having issues with the window.createpopup() method… it won’t stay open… it opens for a second then closes without losing focus or anything….

this is the function that i use…

[code]
function testPopup(refObj){

var popupObj = window.createPopup();
popupObj.document.body.style.border = “1px solid black”;
popupObj.document.write(“<iframe width=100% height=100% frameborder=0 src=’http://www.thecastleaargh.com/’ scrolling=no></iframe>”);
popupObj.show(“0”, “20”, “100”, “200”, refObj);

}
[/code]

and it is supposed to open up the website I want into the frame wich will effectively fill the popup window… but it won’t work… I reference it with a simple <button onclick=”testPopup(this)”>test</button>

is there something wrong that I don’t see… or is it becuase the variable holding the popups info is local to the function only.. or is there something else

if it is becuase the variable is local would you recomend that I simply make it global and define it in the script outside of functions… or should I make the funciton wait for the popup to terminate… thanks for your help ahead of time ?

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@neil9999May 08.2004 — You could try using window.open() instead.

Neil
Copy linkTweet thisAlerts:
@mrchipps69authorMay 10.2004 — I can't use open, they don't have borderless floating windows... i want the effect of a select box only with images in it instead of text.

I just wondered if anyone knew if the scope of the variable used to store the popup info had anything to do with it closing automatically
Copy linkTweet thisAlerts:
@TNONov 25.2006 — Better late than never. I was having the same issue today with my client-side application. it seems you have to keep the window.createPopup();

method global to insure the window stays open. The rest of the code you can stick anywhere you want.
Copy linkTweet thisAlerts:
@roma1123Mar 13.2011 — Hi,

First of all window.createPopup() is not a cross browser function.

But if you anyway need something like that that will work on all major browser you could use the solution from this post:

http://extremedev.blogspot.com/2011/01/ie-windowcreatepopup-cross-browser.html

It can also help with your problem.
Copy linkTweet thisAlerts:
@TNOMar 13.2011 — After 7 years I don't see how any solution will matter much. Besides, the fact that .createPopup() isn't cross-browser was pretty irrelevant back then due to IE's dominance. Nowadays people still use HTML Applications client side which can still utilize this method to simulate chromeless splash screens. Since the OP's question didn't specify, any assumption would be useless. In regards to your posted link, I don't see how adding 29k to 200k+ of code for a simple popup is an improvement.
Copy linkTweet thisAlerts:
@roma1123Mar 13.2011 — After 7 years I don't see how any solution will matter much. Besides, the fact that .createPopup() isn't cross-browser was pretty irrelevant back then due to IE's dominance. Nowadays people still use HTML Applications client side which can still utilize this method to simulate chromeless splash screens. Since the OP's question didn't specify, any assumption would be useless. In regards to your posted link, I don't see how adding 29k to 200k+ of code for a simple popup is an improvement.[/QUOTE]

I agree that it has passed 7 years since then however other people can also need this.

Related to the number of rows of code:

1) the code can be easily put in a .js file and then included there where you need it.

2) When you need a cross browser popup then believe me anyone would be happy to find this link, as I for exaple could not find a real cross browser window.createPopup() function on the internet when I needed it very much.
Copy linkTweet thisAlerts:
@TNOMar 13.2011 — I agree that it has passed 7 years since then however other people can also need this.[/QUOTE]

It's possible.


Related to the number of rows of code:

1) the code can be easily put in a .js file and then included there where you need it.[/QUOTE]


Which still doesn't account for the massive size of the library just to get a popup window.


2) When you need a cross browser popup then believe me anyone would be happy to find this link, as I for exaple could not find a real cross browser window.createPopup() function on the internet when I needed it very much.[/QUOTE]


Only .createPopup() can exist outside browser chrome. No other form of JS hackery will accomplish this.
×

Success!

Help @mrchipps69 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...