Archive: javascript

 

Having issues with javascript dependencies or awkwardly structured html defining objects you need before run? This is a little trick I used combined with csnover's roundrect.js to provide IE versions < 9 with border-radius rounded corners. Create a separate source file e.g. mylateloader.js and in it include the following code :- PLAIN TEXT CODE: function [...]



 

If you have a staging copy of your site anywhere then you might not bother copying over your entire catalogue of product images etc. You might decide to drop in absolute URLs for those images so that they are pulled from live. However you really don't want absolute URLs in your code and you certainly [...]



 

If you are struggling to debug why some ajax, perhaps using jquery etc is working fine when you access the page via http, but if you use https then it fails silently with very little error messaging to work on then this could be your solution. Basically, although you have accessed the page over HTTPS, [...]



 

If you are scratching your head trying to figure out where in your Javascript the mysterious doIt error is coming from when testing using Chrome, this might just save you.. After loads of digging around it turns out that the error is actually caused by the Chrome SEO extension I had installed. Disable that and [...]



 

Check this out: http://jsfiddle.net/ - handy More Reading:



 

If you need to work collaboratively on some Javascript then check out JS Bin It's just like pastebin, but with Javascript compatability, handy. More Reading:Using Live Images on Staging Without Absolute URLs (but a bit of JS)Tip: Javascript late-loading trickTip: Copy CSS Selector in chromeMagento addAttributeToFilter() and addAttributeToSelect()Adding Confirm E-mail Address Field to Magento Frontend [...]



 

Douglas Crockford, author of Javascript the Good Bits and Yahoo's Javascript architect is delivering his famous lectures. The first one is now available to download. Douglas Crockford is Yahoo!'s JavaScript architect and a member of the committee designing future versions of the world's most popular programming language. In the first three months of 2010, Douglas [...]



 

If you are bewildered by the choice of lightbox style javascript plugins available, you might find this page useful: http://planetozh.com/projects/lightbox-clones/ Its a well organised matrix of lightbox clones so you can compare features and choose the right one for your specific requirements. Handy! More Reading:Tip: Javascript late-loading trickTip: Copy CSS Selector in chromeUsing Live Images [...]



 

If you are trying to use associative arrays in Javascript, the first thing is to not use the Array type and instead just use objects. The weird and wonderful thing is that if you create your array as an object, you can still use the array style square brackets to access object properties. So for [...]



 

I seem to use this little snippet loads so I thought I would post it up for safe keeping: Toggling all checkboxes on a page: PLAIN TEXT CODE: <script type="text/javascript"> function toggleCheckboxes() { // written by Daniel P 3/21/07 // toggle all checkboxes found on the page     var inputlist = document.getElementsByTagName("input");     [...]