gettin a popup

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sanjeevcis
    New Member
    • May 2007
    • 8

    gettin a popup

    Hi Everybody,

    I have a popup should be raised when i close a perticular window.i have written a javascript function . And i am calling that function with onunload event.But the problem is whenever i click the refresh button i am getting the popup.

    I dont want it to be happened when i click refresh button because I need the popup only when i close the window.So Please ,if anybody knows the solution,i will be glad to know it.

    mycode is like this........... ..
    [HTML]
    <script>functio n exitPopup()
    {
    window.open("Us erESurvey.php", "ExitPopup","he ight=500,width= 510")
    }
    </script>
    <input type='button' name="how" onclick="exitPo pup()">
    [/HTML]
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    You posted this in the PHP forum. I'm moving it to the JavaScript forum.

    Comment

    • eragon
      Contributor
      • Mar 2007
      • 431

      #3
      so, it opens whenever you refresh, and you dont want it to?

      ok, solution, make a cookie... (I dont know how...) tell the cookie to only display the popup once per visit, and have the cookie deleted when you close the internet browser.

      another thing, whats the purpose of this popup? a thankyou message that appears when the page closes, or...?

      Hope it works... (If you find out how to make a cookie)

      Sincerely,

      Eragon

      Comment

      • eragon
        Contributor
        • Mar 2007
        • 431

        #4
        another thing, if there is a <Body OnLoad="..."> Then shouldn't there be a <Body OnClose="exit_p opup ()"> ???

        Just a thought...

        sincererly,

        Eragon

        Too mucH nachoEs Leave A STRong Impression During Eating houR
        (Thats a code, solve it)

        Comment

        • pbmods
          Recognized Expert Expert
          • Apr 2007
          • 5821

          #5
          Here's a pretty good introduction to JS cookies:
          W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.


          Originally posted by eragon
          Too mucH nachoEs Leave A STRong Impression During Eating houR
          (Thats a code, solve it)
          oo muc nachos eave ong mpression uring ating hou

          I don't get it. :P

          Comment

          • sanjeevcis
            New Member
            • May 2007
            • 8

            #6
            Originally posted by sanjeevcis
            Hi Everybody,

            I have a popup should be raised when i close a perticular window.i have written a javascript function . And i am calling that function with onunload event.But the problem is whenever i click the refresh button i am getting the popup.

            I dont want it to be happened when i click refresh button because I need the popup only when i close the window.So Please ,if anybody knows the solution,i will be glad to know it.

            mycode is like this........... ..
            [HTML]
            <script>functio n exitPopup()
            {
            window.open("Us erESurvey.php", "ExitPopup","he ight=500,width= 510")
            }
            </script>
            <body onunload=="exit Popup()">
            <input type='button' name="how" >
            </body>
            [/HTML]

            I Apologize everybody for my mistake in posting a wrong query ,Actually it was like above code.Once again guys forgive me to trouble you all .

            Comment

            • eragon
              Contributor
              • Mar 2007
              • 431

              #7
              To solve the code you must note all things big... *Capital letters*

              [QUOTE]Too mucH nachoEs Leave A STRong Impression During Eating houR/QUOTE]
              The Last Rider
              =p
              -- Eragon

              Comment

              Working...