General discussion

  • Creator
    Topic
  • #2135163

    Programming in Java Script

    Locked

    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.

All Comments

  • Author
    Replies
    • #3616946

      Programming in Java Script

      by tjc ·

      In reply to Programming in Java Script

      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 section of your main file.

      Put your javascript code into a file that ends in js and then add the 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

      • #3616891

        Programming in Java Script

        by shanghai sam ·

        In reply to Programming in Java Script

        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

    • #3616885

      Programming in Java Script

      by playmejust ·

      In reply to Programming in Java Script

      Point value changed by question poster.

    • #3616836

      Programming in Java Script

      by tjc ·

      In reply to Programming in Java Script

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

    • #3618870

      Programming in Java Script

      by tchoukavine ·

      In reply to Programming in Java Script

      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.

      • #3618849

        Programming in Java Script

        by playmejust ·

        In reply to Programming in Java Script

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

    • #3618790

      Programming in Java Script

      by jay eckles ·

      In reply to Programming in Java Script

      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
      http://www.jayeckles.com

    • #3626774

      Programming in Java Script

      by tjc ·

      In reply to Programming in Java Script

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

      • #3624867

        Programming in Java Script

        by playmejust ·

        In reply to Programming in Java Script

        Sir,

        I know just that nothing is impossible. So, my question will have some good answer from someone oneday!

    • #3566419

      Programming in Java Script

      by tjc ·

      In reply to Programming in Java Script

      I’m just courious now. Did you ever find out how to do it?

      • #3432777

        Programming in Java Script

        by playmejust ·

        In reply to Programming in Java Script

        Please mail me a script that will disable keyboard completely when a web page is loaded. I will give you points on that if it worked correctly.

    • #3432778

      Programming in Java Script

      by playmejust ·

      In reply to Programming in Java Script

      Yes you can

      Hide the menu bar just

    • #3432775

      Programming in Java Script

      by playmejust ·

      In reply to Programming in Java Script

      This question was closed by the author

Viewing 8 reply threads