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,892
Reaction score
7,933
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.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Thread 'Project Documentation'
Trying to package up a small bank account manager project that I have been tempering on for a while. One that is certainly worth something to me. Although I have created methods to whip up quick documents with all fields and properties. I would like something better to reference in order to express the mechanical functions. It is unclear to me about any standardized format for code documentation that exists. I have tried object orientated diagrams with shapes to try and express the...

Similar threads

Back
Top