...

View Full Version : Multiple Pop Up Windows



tmyie
03-16-2012, 07:45 PM
Hello!

I'm trying to make a website that from one link, opens multiple windows. It is for a design project (I'm still at uni). So far I have mustered just the one window.

Here is the website: http://popmeup.org/

The idea is that you get bombarded with lots of nice quotes.

I don't know my arse from my Javascript - but has anyone got any advice?

Philip M
03-16-2012, 08:18 PM
Hello!

I'm trying to make a website that from one link, opens multiple windows. It is for a design project (I'm still at uni). So far I have mustered just the one window.

Here is the website: http://popmeup.org/

The idea is that you get bombarded with lots of nice quotes.

I don't know my arse from my Javascript - but has anyone got any advice?

Yes - forget it! To stop that sort of silly thing all modern browsers block unrequested popups.

All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

tmyie
03-16-2012, 08:36 PM
Yeah, I know it's annoying. But the project is to play on the annoyance of pop up adverts, so I would like to be able to mimic it.

So, it it not possible with modern browsers? I've managed to get the one popped.

Thanks

Philip M
03-16-2012, 08:56 PM
Yeah, I know it's annoying. But the project is to play on the annoyance of pop up adverts, so I would like to be able to mimic it.

So, it it not possible with modern browsers? I've managed to get the one popped.

Thanks

If the user clicks on a link then the popup is not unrequested. But the user would have to request (invite) each popup separately. You cannot "bombard" people with unrequested windows.

webdev1958
03-17-2012, 02:15 AM
Just as well this is for a uni project and not for the "real world" ;);)

When the page finishes loading, it opens a new page for each quote in the quotesA array and writes a quote to its own page. The original window then closes leaving just the pages with quotes open.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title></title>
<style type="text/css"></style>
<script type="text/javascript">
var quotesA = ['quote 1','quote 2','quote 3'];
window.onload=function(){
var newWins = [];
for(i=0; i<quotesA.length; i++){
newWins[i] = window.open(); //open a blank window
newWins[i].document.write('<h1>'+quotesA[i]+'</h1>');
}
self.close(); //close the original page
}
</script>
</head>
<body>
</body>
</html>But bear in mind that the user has the final say, with their browser settings, on whether newWins[i] opens a new window or a new tab in the one browser window. And in at least FF10, the user can block the above new windows in their browser settings. You cannot over-ride the user's preference.

Philip M
03-17-2012, 10:19 AM
self.close(); //close the original page

Throws a warning message in IE.

webdev1958
03-17-2012, 10:22 AM
self.close(); //close the original page

Throws a warning message in IE.

And so it should :) Users should have the final say in whether they really want the window closed or not :thumbsup: (like I posted earlier)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum