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

Frontpage JavaScript

  1. May 18, 2006 #1

    DaveC426913

    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"><!--
    document.write(unescape("%3C%53%43%52%49%50%54%20%74%79%70%65%3D%22%74%65%78%74%2F%6A%61%76%61%73%63%72%69%70%74%22%3E%3C%21%2D%2D%0D%0A%69%66%28%6E%61%76%69%67%61%74%6F%72%2E%75%73%65%72%41%67%65%6E%74%2E%69%6E%64%65%78%4F%66%28%22%4F%70%65%72%61%22%29%21%3D%2
    etc etc etc
    64%6F%77%2E%6F%6E%6D%6F%75%73%65%64%6F%77%6E%3D%6E%72%63%3B%66%75%6E%63%74%69%6F%6E%20%6F%6E%65%28%29%7B%72%65%74%75%72%6E%20%74%72%75%65%7D%6F%6E%65%72%72%6F%72%3D%6F%6E%65%3B%2F%2F%2D%2D%3E%3C%2F%53%43%52%49%50%54%3E"));//--></SCRIPT>


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

    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: May 18, 2006
  4. May 19, 2006 #3

    DaveC426913

    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

    -Job-

    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Frontpage JavaScript
  1. Javascript Help (Replies: 4)

  2. Javascript problem (Replies: 6)

Loading...