Archive for the ‘JavaScript’ Category

HTTPS IE and javascript:void(0);

Well this bit me in the rear for a couple hours today. While doing some maintenance for Westlake Eletronic Supply their webmaster, Chris Bourdon, noticed that on all the HTTPS pages IE8 was giving that wonderfully redesigned (and tricky) security pop-up message informing the user that there are insecure items on the page and asks if you want to view the page without them (yes) or with them (no). We certainly didn’t want that popping up all the time but finding what it was couldn’t have been more difficult. A good addition to the developer tools (F12) would be to point out insecure ‘items’ in pages that should be secure. No no… that would have made things too easy, instead we scoured the HTML and JavaScript source and then pulled out fiddler, as any good webmaster or developer would do, to see if we could track down an actual image or file. No dice.

Needless to say, we’re really expecting to find a “src” attribute who’s value was pointing to a http: location or some javascript/ajax calling an insecure page. Nope and nope, apparently it was all due to one of my favorite scripts, sorttable, adding a javascript:void(0) to a generated script tag to defer script loads (and no, I’m not sure what that means as I’ve never had the need to perform such an insecure thing!). Although this could have been accomplished better in sorttable I have to leave it to IE to pull the “telling me there is a problem but not telling me what that problem is at all or telling me in a way that isn’t as helpful as other browsers that have been around not even half as many years were able to do in very early versions” joke on me. It’s a good one but overplayed almost as much as “I’m on a boat”. You win this time IE *shakes fist*!

jQuery accordion, syntaxhighlighter and searchSuggest added

Well since I’ve been using YUI for the past couple of years I hadn’t paid much attention to jQuery but so far I’m enjoying what seems to be a more streamlined library in general. Both jQuery and YUI have their place in my opinion though. I added the accordion menu to the right with a custom theme and it even let me set a specific section open depending on the page. I had a problem with the accordion jQuery widget and syntaxhighlighter though. I don’t recall exactly what brought me the solution to use beautyOfCode but plugging that right in and changing the html on my code pages seemed to do the trick quite nicely. beautyOfCode is a jQuery plugin that is essentially a wrapper for syntaxhighlighter.

I also added another quick sample to the code section for an AJAX search suggestion drop down I created a couple years back for Westlake Electronic Supply. I haven’t completed an actual search results page yet but for now you can simply enter in words into the search box under the header image and it’ll give you the post which contain those words.

Return top