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 6 of 6
  1. #1
    Regular Coder
    Join Date
    Oct 2010
    Posts
    127
    Thanks
    26
    Thanked 0 Times in 0 Posts

    Can someone explain how to compress .js files?

    OK, I work for a company that accepts donations. Currently, the donation page looks nothing like the rest of the site. So I recreated the page to look like the rest of the site. But when I do so, Chrome shows it as a "security risk". Someone looked at it and told me that it's because the .js files aren't compressed and the browser considers this a security risk.

    So how do I compress the files?

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,701
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    Quote Originally Posted by javanewbie7 View Post
    Someone looked at it and told me that it's because the .js files aren't compressed and the browser considers this a security risk.
    That doesn’t sound like correct advice to me. Never heard of a security risk because of uncompressed JS. It would help us tremendously in finding the actual issue if you gave us a link to the problematic page.

  • Users who have thanked VIPStephan for this post:

    javanewbie7 (07-13-2011)

  • #3
    Regular Coder
    Join Date
    Oct 2010
    Posts
    127
    Thanks
    26
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by VIPStephan View Post
    That doesn’t sound like correct advice to me. Never heard of a security risk because of uncompressed JS. It would help us tremendously in finding the actual issue if you gave us a link to the problematic page.
    Sorry, it took so long to get back to you. Here you go. Currently it's only showing a problem in Chrome.

    http://0.mk/3c90

  • #4
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,374
    Thanks
    11
    Thanked 592 Times in 572 Posts
    oohhhh, i know, i know:

    it's because you serve jquery.js and http://kacv.org/javascript/flash/flashobject.js (and others like hover intent) from http instead of https...
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.6, IE11:9.1, IE9:3.1, IE10:3.0, FF:17.2, CH:46, SF:11.4, NON-MOUSE:38%

  • Users who have thanked rnd me for this post:

    javanewbie7 (07-13-2011)

  • #5
    Regular Coder
    Join Date
    May 2009
    Posts
    425
    Thanks
    3
    Thanked 62 Times in 61 Posts
    I had this same problem a while back. rnd_me is correct.

    When you want users to browse securely (via https)... every single image, script, or anything that loads on the page must be under the same exact domain, or browsers will deem the page unsecure and the https will be crossed out or removed in the address bar (or a message may pop up, depending on the browser).

    Like I mentioned, even an image can do this. For instance, if your secure page URL is https://www.yoursite.com... the image element must look like this:
    Code:
    <img src="/images/someimage.png">
    Or this:
    Code:
    <img src="https://www.yoursite.com/images/someimage.png">
    It cannot be:
    Code:
    <img src="http://www.yoursite.com/images/someimage.png">
    I'm the founder of Loggur, a place to build and share web apps focused on maximizing efficiency and productivity:
    http://www.loggur.com

    My personal site and blog:
    http://www.tfburgess.com

  • Users who have thanked tfburges for this post:

    javanewbie7 (07-13-2011)

  • #6
    Regular Coder
    Join Date
    Oct 2010
    Posts
    127
    Thanks
    26
    Thanked 0 Times in 0 Posts
    Gotcha...makes sense. Thanks!


  •  

    Posting Permissions

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