Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    May 2007
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Myspace pop up box

    ok, on myspace I am trying to make a pop up box. I have done it before but some reason it wont let me do it. I would have wrote down what i typed in at myspace but i acciddently deleted it instead od cuting it. I want a comment box to pop up when you go to my site that says, "Welcome to my Myspace." if the click ok, then i want another comment box to pop up saying "Thank you for pressing ok.." then they can press ok or cancel and it goes away. But if they press cancel on the first pop up box then i want a comment box to say "Why did you press cancel? Did you not want to press ok? Well now you have to start ALL over and do it again." Then weither they press ok or cancel it start them all over again.


    Can somebody help me make this?

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts

    Internet Explorer

    Code:
    function box1()
    {
     var response = confirm("Welcome to MySpace");
     return response;
    }
    
    function box2(response)
    {
     if(response)
     {
     alert("Thank you for clicking OK");
     var tryAgain = false;
     }
     else
     {
     alert("Why did you press cancel? Did you not want to press ok? Well now you have to start ALL over and do it again.");
     var tryAgain = true;
     }
     return tryAgain;
    }
    
    function beAnnoying()
    {
     while(1=1)
     {
      var captureResponse = box1();
      var tryAgain = box2(captureResponse);
      if(!tryAgain)
      {
       break;
      } 
     }
    }
    body.onload(beAnnoying());
    Not tested, so see if it works....

    HTH
    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #3
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    MySpace does not allow JavaScript so I doubt you did it before on there.

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #4
    New Coder
    Join Date
    May 2007
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok lol, i just checked that out. They dont allow it any more..And yes i did use javascript on there before. Thx for help though


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •