What does this script?

Discussion in 'JavaScript' started by interval, Apr 9, 2008.

  1. #1
    Hi,

    What is the effect of following script?

    <script language="JavaScript1.2" type="text/javascript">
    <!--
    if ((navigator.appVersion.substring(0,1) == "5" && navigator.userAgent.indexOf('Gecko') != -1) || navigator.userAgent.search(/Opera/) != -1) {
    document.write('<META HTTP-EQUIV="pragma" CONTENT="no-cache">');
    }
    // -->
    </script>

    Advanced thanks
    Interval
     
    interval, Apr 9, 2008 IP
  2. zerxer

    zerxer Peon

    Messages:
    368
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It appears to set it to not cache the page (must redownload it each time) depending on what browser the user is using. I'm pretty sure it's setting it to cache if they're using Opera and the other one.. I'm not sure. Whatever browser has an appVersion of 5 and uses the word Gecko, which is a lot, though Firefox comes to mind..
     
    zerxer, Apr 9, 2008 IP
  3. interval

    interval Peon

    Messages:
    53
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    A page containing this script is indexd by Google or other SE ?
     
    interval, Apr 9, 2008 IP
  4. zerxer

    zerxer Peon

    Messages:
    368
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Eh? I don't see how this code can help or prevent a search engine from indexing it so yeah it should still index it.
     
    zerxer, Apr 9, 2008 IP