locked
Redirect to a new url from a pop up window RRS feed

  • Question

  • Hi folks I know how to add an event like have a message pop up when a button is clicked.

    I want the user to click the button -- read the message -- when they click ok to close the button I want that to then redirect to a new URL

    Is that Possible? if so how can U get that OK button inside the popup to redirect.

     

    thanks again

     

     

    Thursday, September 8, 2011 9:48 PM

All replies

  • How are you are generating the pop-up?

    It's rather hard to tell you what you might be able to do with it, if anything, without knowing that.

    Thursday, September 8, 2011 10:48 PM
  • Click on this link for a demo of what you asked for:

    http://roundthecounty.com/index_test.html

    Use the view source on your browser to see how it is done.


    • Edited by Time Bandit Saturday, September 10, 2011 1:52 AM
    Friday, September 9, 2011 8:33 PM
  • I'm sure the OP didn't intend to do anything malicious with that code but it is a great way to direct someone to a malware site.
    Friday, September 9, 2011 11:10 PM
  • TB has given you a good example of how easily such things can be done in javascript. Just in case what you're after is to have the user confirm before the transfer, and stay on the same page if declined, I've modified his script slightly, below, to add user confirmation to the process. Adapt as needed for your purposes... ;-)
    <script type="text/javascript">
        function task(){
        var response = confirm("Go to index?");
      if(response) { alert('Message:IE6 Sucks'); document.location.href = "about.htm"; } else { alert("Good to have you stick around!") } } </script>

    cheers,
    scott

    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.
    • Edited by paladyn Friday, September 9, 2011 11:13 PM
    Friday, September 9, 2011 11:12 PM
  • I'm sure the OP didn't intend to do anything malicious with that code but it is a great way to direct someone to a malware site.


    ???

    What are you talking about?

    An ordinary hyperlink on a page can accomplish that. This is nothing more than a way to provide an announcement or other presentment before making the transfer.


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.
    Saturday, September 10, 2011 1:01 AM
  • "What are you talking about?"  I am talking about using a script to go to another URL. That is NOT the same as a 'ordinary hyperlink' as the script link URL is not shown on the browser as you mouse over the script link so you do not know where it is taking you.

     

    Saturday, September 10, 2011 8:06 PM
  • Ah, yes. I had (obviously) not considered that factor. Point taken.

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.
    Saturday, September 10, 2011 9:22 PM
  • The question about taking someone to a malware site is a little silly. As a designer, just because you use a javascript redirect doesn't mean that you will be sending anyone to a malware site. If you don't ever use javascript to redirect doesn't mean that other bad sites out there won't. That's a bit like saying "don't ever use money because money can be used to buy hookers and/or Congress."

    Also, just because the URL is shown, it will not stop most people from clicking on it anyway. Do you think that a malware site has a disclaimer in the URL? Something like:

    http://this_site_will_kill_your_computer.com

    Anyway, if you want the user to see the URL they are going to be redirected to - before they say OK - then show them the link. I changed the example code to do so along the lines that Scott described.



    • Edited by Time Bandit Saturday, September 10, 2011 10:18 PM
    Saturday, September 10, 2011 10:12 PM
  • Warpig, didn't like the answer you got?
    Wednesday, September 14, 2011 2:22 AM