SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    hiding a .js file

    In a production environment, are there any issues with including statements like

    $('#revcntnr').load('/js/revdetlkup.ajax.php', passdata);

    in a .js file?

    Is there any way to keep someone from retrieving the file by simply reviewing page source and clicking on the src='/js/script_f1.js' to retrieve the file.

    I guess my concern is disclosing directory structure and file names. Again, are there any issues with making those public?

    Thanks

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by bostboy View Post
    I guess my concern is disclosing directory structure and file names. Again, are there any issues with making those public?
    Normally there are no issues. If you do have any concerns though, you can pass parameters to a centralised php file which will then fetch and return the data for you from a private location.

    Even if you do that though, the content is the js file will still be publicly available. That's just the state of things, when you provide information that's to be run on a users local web browser.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Evangelist
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thought about doing it that way but wanted to verify there were no issues there. Thanks, I really appreciate the input.


Bookmarks

Posting Permissions

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