Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Apr 2007
    Posts
    179
    Thanks
    17
    Thanked 0 Times in 0 Posts

    View Javascripts

    If I include a javascript file as

    <script language="JavaScript" type="text/javascript" src="js/test.js"></script>

    in a jsp page.

    When the page is loaded, the users can use the View Page Source function to see the above line of code.

    My question: Can the users see the content of the test.js file as indicated above? If so how could they do it?


    Thanks
    Last edited by otnj2ee; 10-30-2012 at 02:43 AM.

  • #2
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,108
    Thanks
    38
    Thanked 498 Times in 492 Posts

    Lightbulb

    Quote Originally Posted by otnj2ee View Post
    If I include a javascript file as

    <script language="JavaScript" type="text/javascript" src="js/test.js"></script>

    in a jsp page.

    When the page is loaded, the users can use the View Page Source function to see the above line of code.

    My question: Can the users see the content of the test.js file as indicated above? If so how could they do it?


    Thanks
    Have you tried it?
    Click on the .js file in the <script> tag after viewing the source and see what is displayed.

  • #3
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    Or, you can just copy/paste the URL to the .js file in the browser. It will appear in the browser in clear text.

    You CANNOT hide static code from users. Period. HTML or JavaScript is viewable either by View Source, or by typing the URL to the .js file into the browser. Obfuscating is a waste of time. The browser must get the code in order to parse it. The user can see it.

    Only server-side code is not easily viewed.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •