open popup ( window.open ) without getting security message

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bnashenas1984
    Contributor
    • Sep 2007
    • 257

    open popup ( window.open ) without getting security message

    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?


    [CODE=javascript]
    <script type="text/javascript" >
    window.open('my page.php','page name','toolbar= 0,scrollbars=0, location=0,stat usbar=0,menubar =0,resizable=0, width=500, height=360, left=200, top=200 ');
    </script>
    [/CODE]
    Last edited by pbmods; Sep 24 '07, 11:49 PM. Reason: Changed [CODE] to [CODE=javascript].
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    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.

    Comment

    • bnashenas1984
      Contributor
      • Sep 2007
      • 257

      #3
      thanks for the reply..
      Your right... so i better use another way to notice my users

      Comment

      • pbmods
        Recognized Expert Expert
        • Apr 2007
        • 5821

        #4
        Heya, bnashenas.

        What is the purpose of your popup window? Is it an exit survey?

        Comment

        • bnashenas1984
          Contributor
          • Sep 2007
          • 257

          #5
          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

          Comment

          • pbmods
            Recognized Expert Expert
            • Apr 2007
            • 5821

            #6
            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.

            Comment

            • bnashenas1984
              Contributor
              • Sep 2007
              • 257

              #7
              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

              Comment

              • pbmods
                Recognized Expert Expert
                • Apr 2007
                • 5821

                #8
                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'.

                Comment

                • bnashenas1984
                  Contributor
                  • Sep 2007
                  • 257

                  #9
                  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...
                  Last edited by bnashenas1984; Sep 25 '07, 02:00 AM. Reason: Details should be deleted

                  Comment

                  • ganesanji
                    New Member
                    • Jun 2007
                    • 16

                    #10
                    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...

                    Comment

                    • acoder
                      Recognized Expert MVP
                      • Nov 2006
                      • 16032

                      #11
                      Post your code, so we can assist you.

                      Comment

                      • ganesanji
                        New Member
                        • Jun 2007
                        • 16

                        #12
                        hi,

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

                        this is a part of my profile.php page...
                        Code:
                        <span id="openPMbox">
                        <?
                        	$sql1 = "SELECT * FROM `chat_messages` WHERE touserID='".$_SESSION['userID']."' AND status='0'";
                                        $query1 = mysql_query($sql1)or die(mysql_error());
                                        while ($res1 = mysql_fetch_array($query1)) {            
                        				
                        	            echo "<script language='javascript'>openChat(\"Messenger/convo.php?sessionID=".$res1['sessionID']."\", \"Convo\");</script>";
                                        }
                        ?>
                        </span>
                        <div id="buddy">
                        </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....
                        Last edited by acoder; Dec 3 '08, 01:54 PM. Reason: Added [code] tags

                        Comment

                        • acoder
                          Recognized Expert MVP
                          • Nov 2006
                          • 16032

                          #13
                          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.

                          Comment

                          Working...