Results 1 to 3 of 3

Thread: script causing 404 and other issue in HTTPS...

  1. #1
    Join Date
    May 2013
    Posts
    15
    Thanks
    11
    Thanked 1 Time in 1 Post

    Default script causing 404 and other issue in HTTPS...

    Ok, so first off I am a beginner with JS -

    We implemented a neat script for a drop down menu and as we are nearing launching the new site with the new menu we found a major issue. When we go the cart (or any https page), we notice in google tracking that we show up as a 404 error, which appears to be the .js file reaching out to 'blank.htm' - which I have found in the file, but don't know how to modify the function so the script will work. Also, in the cart, upon hovering over the menu, the header from above appears to flash underneath it.

    This is code in the .js file that I think we need to adjust:

    Code:
    addshim:function($){
    	$(document.body).append('<IFRAME id="outlineiframeshim" src="'+(location.protocol=="https:"? 'blank.htm' : 'about:blank')+'" style="display:none; left:0; top:0; z-index:999; position:absolute; filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)" frameBorder="0" scrolling="no"></IFRAME>')
    	this.$shimobj=$("#outlineiframeshim")
    },
    Here is a link to view the new design of our site: http://shawntrautman.com/index.aspx?theme=124

    Any help would be greatly, extremely appreciated-
    Last edited by jscheuer1; 05-08-2013 at 09:16 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,133
    Thanks
    44
    Thanked 3,231 Times in 3,192 Posts
    Blog Entries
    12

    Default

    Right. All content on an SSL (https pages) must also be https. On an insecure page, the script uses the about:blank address which is a stock blank page built into the browser, all browsers have this. But if it uses that on a secure page, it's seen as insecure. Some browsers will give a security violation notice, others just won't show it, or might throw an error. So for secure pages the script looks for blank.htm. But it's not there in your case so you get a 404.

    All you have to do is make up a page with nothing on it. It can be completely empty or have just minimal HTML code with no content:

    HTML Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    
    </head>
    <body>
    
    </body>
    </html>
    Save that or a completely empty file as blank.htm and put it in the same folder as your https page. Or if you have a lot of pages that need this in different folders, you can provide the absolute path to the file in the script. Just make sure that the file is on the https part of the site and provide that in the path, example:

    Code:
    addshim:function($){
    	$(document.body).append('<IFRAME id="outlineiframeshim" src="'+(location.protocol=="https:"? 'https://www.oursite.com/files/blank.htm' : 'about:blank')+'" style="display:none; left:0; top:0; z-index:999; position:absolute; filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)" frameBorder="0" scrolling="no"></IFRAME>')
    	this.$shimobj=$("#outlineiframeshim")
    },
    Using a text only editor like NotePad, insert the actual path to this file into the script as shown.

    The browser cache may need to be cleared and/or the page refreshed to see changes.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    claytonbrown (05-08-2013)

  4. #3
    Join Date
    May 2013
    Posts
    15
    Thanks
    11
    Thanked 1 Time in 1 Post

    Default

    John... no homo... (not that theres anything wrong with that though) ... But I could kiss you right now. You are THE MAN! I am adding this to my small library of JS knowledge and am forever in your debt. Thank you ever ever so much.

    I have simply uploaded 'blank.htm' to the root as you suggested and the site appears to running flawlessly in the HTTPS side.

    Again, thank you thank you thank you!

Similar Threads

  1. Accordion script not opening in https: ?
    By MTuttle in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 11-19-2012, 10:12 PM
  2. script conflict causing IE error
    By gylim78 in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 04-13-2009, 04:58 PM
  3. Replies: 4
    Last Post: 03-07-2008, 09:56 AM
  4. How to redirect to a HTTPS pages using DD script
    By ajaxdude in forum Dynamic Drive scripts help
    Replies: 5
    Last Post: 12-14-2006, 06:12 AM
  5. script causing security problems
    By dwsmark in forum JavaScript
    Replies: 1
    Last Post: 10-28-2005, 05:26 AM

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
  •