how to invoke popup that is not blocked?

K

Keith Smith

How can I invoke a popup that is not blocked? I know it can be done because
I have seen it.

My goal is to pop up an image that has a BLACK background color (not white -
otherwise I could just directly link to the picture file).
 
M

Martin Honnen

Keith said:
How can I invoke a popup that is not blocked? I know it can be done because
I have seen it.

It depends on the browser configuration, the normal configuration
nowadays is usually to block unrequested popups but to allow requested
ones meaning when the browser users hits a link or a button you can open
your popup e.g.
<a href="whatever.html" target="windowName"
onclick="var win = window.open(this.href, this.target,
'width=400,height=300,scrollbars,resizalbe');
return win != null;">link</a>
 
M

Michael Winter

How can I invoke a popup that is not blocked? [...]

Pop-ups that are requested - indicated by an explicit user action, such
as a mouse click - are /usually/ shown, but some people will block all
pop-ups unconditionally, particularly if they are using a third-party
system (rather than one that's built-in).
My goal is to pop up an image that has a BLACK background color (not white -
otherwise I could just directly link to the picture file).

The only way you will be able to do that is by linking to a HTML file.
The white background is controlled by application or operating system
preferences. A pop-up will not help you.

Mike
 
K

kaeli

How can I invoke a popup that is not blocked? I know it can be done because
I have seen it.

My goal is to pop up an image that has a BLACK background color (not white -
otherwise I could just directly link to the picture file).

Modify as desired.
(from my script that opens a help window: tested successfully in MSIE5/6,
Opera 7+, and Gecko/Firefox)

SCRIPT:
var h_window = null;
var h_array = new Array();
/* descriptions that remain constant */
h_array["help"] = "<p>Click on any of the help icons to bring up a javascript
window with relevant information.</p>";
h_array["h_zip"] = "<h1>Zip Code</h1>"+
"<p>Description: The zip code for this office.</p> "+
"<p>Allowable values: 5-digit zip code only, no dashes.
</p>";


/* functions that get called when user presses a help button */
function openHelp(screenName)
{
if (!h_window || h_window == null || typeof h_window == "undefined" ||
h_window.closed || !h_window.document)
h_window = window.open("","Help","height=200,width=
200,scrollbars=yes,resizable=yes");
var doc = h_window.document;
doc.open();
doc.writeln("<html><head><title>Help</title>");
doc.writeln("<link rel='stylesheet' type='text/css'
href='myStylesheet.css'>");
doc.writeln("</head><body>");
doc.writeln(h_array[screenName]);
doc.writeln("</body></html>");
doc.close();
h_window.focus();
return;
}


HTML:
<p> <a href="javascript:eek:penHelp('help')"><img src="help.gif" border="0"></a>
&nbsp; Click any help icon for more information.</p>

--
 
R

RobB

Michael said:
On 05/05/2005 15:23, Keith Smith wrote:
(snip)


The only way you will be able to do that is by linking to a HTML file.
The white background is controlled by application or operating system
preferences. A pop-up will not help you.

Michael...how about...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script type="text/javascript">

function getHTML()
{
return [
'<body ' ,
'style="background:url(' ,
'http://www.light-speed-web-graphics.com/' ,
'stripes_horiz_darker/fastest_00077.GIF);' ,
'margin:0;cursor:pointer;" ' ,
'onload="document.title=\'...The Rutles !\'" ' ,
'onblur="setTimeout(\'self.focus()\',100)" ' ,
'onclick="self.close()">' ,
'<img src="http://www.rutles.org/rpix/rutles.jpg" ' ,
'style="border:1px #000 solid;margin:16px;">' ,
'</body>'
].join('');
}

function picpop()
{
pop = window.open(
'javascript:eek:pener.getHTML()',
'pop',
'width=566,height=569' +
',left=160,top=80' +
',status=0'
);
}

</script>
</head>
<body>
<button onclick="picpop()">- open me -</button>
</body>
</html>

Not really linking, per se...
 
M

Michael Winter

Michael Winter wrote:

[Need to use a file]
Michael...how about...

I prefer Mike. :)

[Code that generates HTML]
Not really linking, per se...

For all intents and purposes, it's the same thing but less reliable
(assuming we're dealing with a general audience). You could argue that
the script could be made extensible, but then again so can something
server-side.

My impression is that the OP believes a pop-up can provide the black
background. I'm trying to point out that this isn't the case.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top