General discussion

Locked

Programming in Java Script

By playmejust ·
Is it possible by javaScript to secure a page? I mean to say that Can I hide the 'view' button from Menu-Bar of Internet Explorer/Netscape using JavaScript?

Please assist. I have just succeeded to solve the problem of right click, i.e., I succeeded in barring Right Click.

I am just interested to donot allow the viewers to view the prog tech of my web page just by hiding view button from menu-bar either they are online or offline.

This conversation is currently closed to new comments.

16 total posts (Page 1 of 2)   01 | 02   Next
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Programming in Java Script

by tjc In reply to Programming in Java Scrip ...

There are 4 things you can do, but they are not fool proof.

1. use the window.open command as such -
window.open("newur4l","new window name","menubar=no")
this opens the specified url in a new window with no menubar

2. use an external javascript file by placing a variation of the following in the <head> section of your main file.
<script language="JavaScript" src="your javascript file name here.js"></script>

Put your javascript code into a file that ends in js and then add the <scripting code> mentioned above making the src= the name of the file you created. and upload both files.
Limitation of this is that people could read the file directly by putting the name in the url to see the file.

3. get a javascript encoding program off the net....http://www.15seconds.com/issue/010104.htm

4. using server side javascipts on your server. I haven't done any of that but you could give that a try.
http://developer.netscape.com/viewsource/kuslich_ssjs2.htm

Collapse -

Programming in Java Script

by Shanghai Sam In reply to Programming in Java Scrip ...

I was asking that is it possible to hide just view button from menu bar of Internet Explorer, except all other menu bar buttons, such that File, Edit, Tools, etc buttons are visible but only view button is disabled.

Anyway thanks so much 4 your help.

Sukumar

Collapse -

Programming in Java Script

by playmejust In reply to Programming in Java Scrip ...

Point value changed by question poster.

Collapse -

Programming in Java Script

by tjc In reply to Programming in Java Scrip ...

Your answer is no. You have to take the menu bar fully away.

Collapse -

Programming in Java Script

by playmejust In reply to Programming in Java Scrip ...

Okay thanks.

Collapse -

Programming in Java Script

by tchoukavine In reply to Programming in Java Scrip ...

Don't hope to hyde your prog tech. The veiwer in interest can find texts of all your progs in temp internet files of browser on local PC.

Collapse -

Programming in Java Script

by playmejust In reply to Programming in Java Scrip ...

Ok Thanks, you did not saw my problem and instead of solutions, I donot accept anything else.

Collapse -

Programming in Java Script

by Jay Eckles In reply to Programming in Java Scrip ...

Don't reject this answer because it's not what you want to hear: it's the correct answer...

You cannot hide your HTML or Javascript source from viewers on the web. End of statement. Period.

To answer your specific question, can you disableor hide the "View" item from the main menu...the answer is simply No. Netscape does not provide an API to anything other than the document. There is a navigator object, and you'll notice that virtually everything in it is read-only. There is no API to manipulate the menu. Check the Netscape Javascript documentation at http://developer.netscape.com/docs/manuals/js/client/jsref/index.htm.

Likewise, it is not possible to manipulate the main menu in Internet Explorer. Unlike Netscape, IE does provide an API to the Explorer object. However, this API does not provide any accessibility or setter methods that deal with main menus (it does give control over context menus). To see the documentation on this, I suggest that you go to the MSDN Web Workshop at http://msdn.microsoft.com/library/default.asp?url=/workshop/entry.asp.

If you are successfully able to disable the "View" menu in IE (which I don't know how to do and I'm a pretty talented Javascript and VBScript programmer), what if the user is using Netscape? Disable it in both IE and Netscape, I'll fire up Opera. Or Lynx. If you manage to disable the view source function of every browser I have, then I'll just look in my cache for the HTML page. If you make the page uncacheable, then I'll just telnet to port 80 of your web server and type GET / HTTP/1.1, hit return twice, and get all the HTML source I want from you site. Come to think of it, what if I just turn off Javascript? There is NOTHING you can do to hide your source.

Save yourself the trouble and don't try to hide your web source.

Jay Eckles
www.jayeckles.com

Collapse -

Programming in Java Script

by playmejust In reply to Programming in Java Scrip ...

Sir,

I know just that nothing is impossible.

Collapse -

Programming in Java Script

by tjc In reply to Programming in Java Scrip ...

Why did you say "ok thanks" to my answer and still reject it?

Back to Web Development Forum
16 total posts (Page 1 of 2)   01 | 02   Next

Related Discussions

Related Forums