Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Delay cflocation

    I would like visitors to view a "thank you for your submission" message before being redirected to another URL.
    Is there any way to delay the processing of a cflocation tag?
    H3ath0r Guest

  2. Similar Questions and Discussions

    1. CFlocation.
      I?m interested to know whether it?s good practice to write long CF coded pages or segment CF code into several different CF pages and use cflocation...
    2. What does a session have to do with <cflocation>
      <cflock name="URLToken_lock" type="readonly" timeout="30"> <cflocation url="successful_signin.cfm?#session.URLToken#" addtoken="No"> </cflock>
    3. cflocation
      Does anyone know a way to use cflocation to load a page into a specific target within a frameset? I am working with multiple framesets and I am...
    4. CFLocation and SSL
      I am moving someone on a site from a form on an http or https. I post to a page that queries a DB and then redirects based upon the form post. The...
    5. Delay before cflocation
      Some browsers may have Meta Refresh disabled, which may present a problem to users if there is a broad user base. Are there any alternatives to...
  3. #2

    Default Re: Delay cflocation

    You can use javascript to accomplish this.

    There's an example below. Check out
    [url]http://www.devguru.com/Technologies/ecmascript/quickref/win_settimeout.html[/url] for
    documentation.



    <html>
    <head>
    <script type="text/javascript">
    var timeout = 3000;
    function displayMessageAndTimeout()
    {
    var redirect = confirm("Session is over. Redirect to Yahoo?");
    if (redirect) location.href="http://www.yahoo.com";
    else alert("Ok, I won't send you anywhere.");
    }
    </script>
    </head>
    <body onLoad="javascript:setTimeout('displayMessageAndTi meout()', timeout);">
    After <script language="javascript">document.write(timeout/1000);</script>
    seconds, an alert will appear.
    </body>
    </html>

    BSterner Guest

  4. #3

    Default Re: Delay cflocation

    Well, yes, okay. But if we're gonna go javascript, then how about the smoother
    version where you automatically get transferred after a 5 second delay and the
    user gets the ubiquitous "Click here if you are not automatically transferred
    to www.location.com"


    H3ath0r Guest

  5. #4

    Default Re: Delay cflocation

    Going to use the ol' meta refresh:

    <META http-equiv="refresh" content="10; URL=http://www.website.com">
    H3ath0r Guest

  6. #5

    Default Re: Delay cflocation

    you could use
    <meta http-equiv=refresh content="2;URL=http://www.location.com">,here 2 is 2
    seconds delay before it loads the url.

    And then add code to the same page like

    If the transfer does not start automatically then click <a
    href="http://www.location.com"> here</a>

    CFDEBUG Guest

  7. #6

    Default Re: Delay cflocation

    You could also use this to pause:



    <cfparam name="attributes.interval" default="10"/> <!--- 10 Sec Pause --->

    <cfscript>
    thread = createObject("java", "java.lang.Thread");
    thread.sleep(javaCast("long", 1000*attributes.interval));
    </cfscript>

    reactionnetworks Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139