Log in

View Full Version : script causing 404 and other issue in HTTPS...



claytonbrown
05-08-2013, 08:09 PM
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:


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-

jscheuer1
05-08-2013, 08:32 PM
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:


<!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:


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.

claytonbrown
05-08-2013, 09:01 PM
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!