473,394 Members | 1,932 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

open popup ( window.open ) without getting security message

258 100+
I have a page which opens a little popup to show recieved messages but when ever the page tries to open the popup the user should click on the yellow message on top of internet explorer and click on ( allow popup ) otherwise the popup will not be showed
Is there any way to open this window without getting permission?


Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" >
  2. window.open('mypage.php','pagename','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0, width=500, height=360, left=200, top=200 ');
  3. </script>
  4.  
Sep 24 '07 #1
12 6537
pbmods
5,821 Expert 4TB
Heya, bnashenas.

The only way to do that is to open the window when the User clicks on a link.

If you could bypass the security message, then pop-up ads could do it, too, which would defeat the whole purpose of the pop-up blocker.
Sep 24 '07 #2
bnashenas1984
258 100+
thanks for the reply..
Your right... so i better use another way to notice my users
Sep 24 '07 #3
pbmods
5,821 Expert 4TB
Heya, bnashenas.

What is the purpose of your popup window? Is it an exit survey?
Sep 25 '07 #4
bnashenas1984
258 100+
Actualy I'm making a website for students... I also made a chat room for people to write to each other directly.. Each time someone recieves a private message a window should come up and show the message... Actualy its working fine now but the person should allow the popup to see the message which is not so normal for a website like this... and many people don't trust popups..

Anyway... as you said its hard or maybe impossible to find a way thru IE popup alerts
Sep 25 '07 #5
pbmods
5,821 Expert 4TB
Heya, bnashenas.

Consider instead of opening a pop-up window right away, create a highly-visible link on the page somewhere that advertises that they have a new message.

When the User clicks the link, he is giving you 'permission', if you will, to open the pop-up.
Sep 25 '07 #6
bnashenas1984
258 100+
Yes your right about that... I'v been thinking about something like a link
But in order to do this the page must be refreshed which is not so nice to refresh the window every 5 seconds... I'v made an invisible IFRAMe which refreshes every 5 seconds and gets new messages... and when there is a new message something like a popup should come up
Sep 25 '07 #7
pbmods
5,821 Expert 4TB
Heya, bnashenas.

Create a hidden div that is absolutely positioned, and when a new message is available, set the div's display style property to '' instead of 'none'.
Sep 25 '07 #8
bnashenas1984
258 100+
It's a great idea... but the problem is that the person can recieve messages from more than 1 person... then we need to open more than one popup... and we also have to change the text of the link...
Sep 25 '07 #9
hi bnashenas,

I am also developing a chat app like u. How u used the Iframe for refreshment and to popup the window. Plz Help me. I am struggling in this. If u suggest ,it would be a great help for me....
thanks a lot in advance...
Dec 2 '08 #10
acoder
16,027 Expert Mod 8TB
Post your code, so we can assist you.
Dec 2 '08 #11
hi,

thanks for ur reply. I have given my code below...

this is a part of my profile.php page...
Expand|Select|Wrap|Line Numbers
  1. <span id="openPMbox">
  2. <?
  3.     $sql1 = "SELECT * FROM `chat_messages` WHERE touserID='".$_SESSION['userID']."' AND status='0'";
  4.                 $query1 = mysql_query($sql1)or die(mysql_error());
  5.                 while ($res1 = mysql_fetch_array($query1)) {            
  6.  
  7.                 echo "<script language='javascript'>openChat(\"Messenger/convo.php?sessionID=".$res1['sessionID']."\", \"Convo\");</script>";
  8.                 }
  9. ?>
  10. </span>
  11. <div id="buddy">
  12. </div>
In this file I used the DIV tag "buddy" to display the online friends using ajax.

When ever friends coming online I can see the online friends and if I click on his name , it will open a chat window. If I send any message, it sets the status of the message as "0" to the target user.

In the target user (friend) side, I need to open the chat window to display the message by executing the above query for every 3 seconds.
This is what my problem exactly, i need to open chat popup window automatically by executing MySQL for every 3 or 4 seconds.

I am struggling here for 3 day. If u have any suggestions or any alternative way to do this plz tell me. It will be great help for me....plz guide me....

thanks a lot in advance....
Dec 3 '08 #12
acoder
16,027 Expert Mod 8TB
To do anything every 3/4 seconds, use a setInterval(). However, it wouldn't be a good idea to open a popup window every few seconds. What you can do is use DHTML to create a pseudo-popup within the same window or reuse an existing window.

PS. please use [code] tags when posting code. Thanks.
Dec 3 '08 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: venkatesh | last post by:
Hi Members, I have used the below mentioned code to open a html page in a new browser. The window size is 200 x 300. In that browser, I've given code to open another browser of the same size....
19
by: Albretch | last post by:
Hi, client wants for a window with no toolbars to open (technical and 'esthetical' reasons) after the window, user clicks on, is being closed. I told them about security settings in browsers...
23
by: Markus | last post by:
Hi, i have this problem: Sometimes, i can't reproduce, if i click on an small image on the website, the popup _AND_ an other Tab in firefox open. Here are the linkcode: <div...
29
by: wayne | last post by:
Hey there... I'm having some problems passing url parameters with an open.window command. I'm not terribly familiar with java script but here is the code below. When executed it opens the...
3
by: Bob | last post by:
I am trying to create a popup page (to act as a menu) from a parent page. When the parent page (index.jsp) calls my popup function (see below) it will properly open the correct size browser window...
13
by: ldan | last post by:
Hi everybody, I would not consider myself an expert in javascript - but so far whatever I know, helped me reaching my goals. Recently I started to experience a lot of javascript errors related...
6
by: VK | last post by:
I'm using window.open method in my script to open poup window. Recently Internet Explorer users reported that the script crashes on their machine with different runtime errors. See the bug:...
7
by: anthony.turcotte | last post by:
Hi, I've looked for a solution to this problem on google, read posts in this newsgroup and I still haven't found anything that could help me. Here's the scenario. 1. User accesses...
19
by: Sonnich | last post by:
Hi! I have used JS, but I am still new to it. I have something like this: oNewWindow = new Object(); oNewWindow = open("sonnich.xls","Qopen","resizable=yes,scroll=yes, status=yes,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.