943,147 Members | Top Members by Rank

Ad:
Jan 22nd, 2010
0

popup in ie8

Expand Post »
Hi I am trying to dynamically open a popup window but ie8 blocks it with the popup blocker.

basically within a ajax fuction I have a confirm button and if the user clicks yes it opens a popup window.

now I tried it with a javascript function but it got blocked, so I have tried it by creating a form with a button in it and instead of calling the popup function direct I call document.form.button.click

and in the form my button has onclick"popup('<? echo url; ?>')"

but this also is detected as a unwarranted popup and is blocked.

now I understand that the popup blocker works when a popup is called without user interaction, but allows popups on say button clicks.

how can I get the popup to work

any help and I would be hugely grateful

many thanks
Barry
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
barryw33 is offline Offline
15 posts
since Jan 2010
Jan 22nd, 2010
0
Re: popup in ie8
dont use a popup,
you are already using ajax functions, so use ajax to put the form in a layer, and onclick change the z-index and visibility of the layer to put it on top of everything else, so the user has to complete the form and submit/close the layer to continue
the same functionality as the private message prompts on this forum
this is a scrap of
html Syntax (Toggle Plain Text)
  1. <button id="frorm" align="center" onClick="showIt();">Important Information</button><script type="text/javascript">
  2. <!--
  3. (document.getElementById) ? dom = true : dom = false;
  4. function hideIt() {
  5. if (dom) {document.getElementById("layerm1").style.visibility='hidden';}
  6. if (document.layers) {document.layers["layerm1"].visibility='hide';} }
  7. function showIt() {
  8. if (dom) {document.getElementById("layerm1").style.visibility='visible';}
  9. if (document.layers) {document.layers["layerm1"].visibility='show';} }
  10. --></script><div id="layerm1" style="position:fixed; left:10px; top:30px; width:95%; visibility:hidden; padding:10px; margin:10px; background:#ececec; border: 1px solid black;">
  11. AJAX FORM
  12. <button id="form" onClick="hideIt();">Close</button></div>
that demonstrates the principle, but not the ajax needed to replace that TEXT with your form
Last edited by almostbob; Jan 22nd, 2010 at 10:18 am.
Reputation Points: 561
Solved Threads: 365
Posting Maven
almostbob is offline Offline
2,966 posts
since Jan 2009
Jan 22nd, 2010
0
Re: popup in ie8
My problem is that the layer must hold a private chat window run in ajax and within that window are php/mysql functions, so unless a layer can include code then I cannot use it
Last edited by barryw33; Jan 22nd, 2010 at 10:48 am.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
barryw33 is offline Offline
15 posts
since Jan 2010
Jan 22nd, 2010
0
Re: popup in ie8
the layer can include any code you want, its just a html element, div p span table, the chat window, anything can be a layer

as I understand it thats what ajax does
ajax is returning php to a part of the current window
I'm not confident with ajax code
but at worst you could the chat in an iframe in the layer (tacky)
and put the close button in the chat page as onclick='top.hideIt();' its certain that a popup window is not going to work, malware concerns mean nobody will disable their popup blocker

you could probably copy the ajax chat code into the <div></div>
Last edited by almostbob; Jan 22nd, 2010 at 11:36 am.
Reputation Points: 561
Solved Threads: 365
Posting Maven
almostbob is offline Offline
2,966 posts
since Jan 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: recommendations for JavaScript learning resources?
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Javascript Dynamic Object ID's





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC