Frontpage JavaScript: Understanding the Code Block

  • Context: Java 
  • Thread starter Thread starter DaveC426913
  • Start date Start date
  • Tags Tags
    Javascript
Click For Summary

Discussion Overview

The discussion centers around a block of JavaScript code found in a Frontpage-built website. Participants are exploring the purpose and functionality of this code, which includes elements of browser detection and user interaction control. The scope includes technical explanation and conceptual clarification regarding the use of JavaScript in web development.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant questions the purpose of the JavaScript code block, seeking clarification on its function.
  • Another participant references an external resource that discusses encoding and decoding in JavaScript, suggesting it may help understand the specific use of escaping in the code.
  • It is noted that the code performs browser detection and attempts to disable right-click functionality, although the rationale for these features is unclear.
  • A participant comments on the use of escape and unescape functions to obfuscate code, describing it as an interesting strategy.

Areas of Agreement / Disagreement

Participants express varying levels of understanding regarding the code's purpose, with some agreeing on its functions while others remain uncertain about the implications and motivations behind its use.

Contextual Notes

There is a lack of consensus on the specific reasons for the code's implementation and its effectiveness in the context of the website. The discussion also highlights the potential for different interpretations of the code's functionality.

DaveC426913
Gold Member
2025 Award
Messages
24,467
Reaction score
8,725
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.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 36 ·
2
Replies
36
Views
4K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 18 ·
Replies
18
Views
15K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K