Java Frontpage JavaScript: Understanding the Code Block

  • Thread starter Thread starter DaveC426913
  • Start date Start date
  • Tags Tags
    Javascript
AI Thread Summary
The discussion centers on a block of JavaScript code found in a website built with Frontpage. The code utilizes the `unescape` function to decode a string that includes a script for browser detection and to disable right-click functionality. The purpose of this code is to identify if the user is using the Opera browser and to prevent users from easily copying content through right-clicking. This technique of encoding and hiding code is noted as an unusual strategy, likely a feature of Frontpage. The conversation references a tutorial for further understanding of the encoding and decoding process involved.
DaveC426913
Gold Member
Messages
23,839
Reaction score
7,835
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?
 
Technology news on Phys.org
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 by a moderator:
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.
 
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.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

Similar threads

Back
Top