Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

JavaScript Frontpage JavaScript

  1. May 18, 2006 #1


    User Avatar
    Gold Member

    I'm looking at this site that I may need to modify. It was built in Frontpage.

    I'm not familiar with FP. There's a block of code the top like this:

    <SCRIPT type="text/javascript"><!--
    etc etc etc

    What is this block for/doing?
  2. jcsd
  3. May 18, 2006 #2
    http://scriptasylum.com/tutorials/encdec/encode-decode.html" [Broken]

    This page will explain what is being done, although i'm not quite sure exactly what its "escaping" for your particular site. I'm sure you could find out though.

    It turns out to be something like...

    <SCRIPT type="text/javascript"><!--
    if(navigator.userAgent.indexOf("Opera")!=. Î dow.onmousedown=nrc;function one(){return true}onerror=one;//--></SCRIPT>
    Last edited by a moderator: May 2, 2017
  4. May 19, 2006 #3


    User Avatar
    Gold Member

    OK, thanks.

    So that code does a couple of things:
    1] it's a browser sniffer
    2] it defeats right-clicking

    Not really sure why these are hidden, but I think it's a built-in FP feature.
  5. May 21, 2006 #4


    User Avatar
    Science Advisor

    You use escape to URL-Encode a string and unescape for the reverse operation. It's the first time i've seen it used to "hide" code. It's an interesting strategy.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook