FancyBox 2 - Ajax get

I occasionally have to get a FancyBox (light-box) working.  I was recently having issues getting a FancyBox to work with IE 9/10.  It worked fine in Chrome, but that’s not the point.

I found a useful stackoverflow post which gives some background detail on getting a FancyBox to work.  After some tweaks, I found that “e.preventDefault();” stopped IE from “forwarding to /my/ajax/url/${account[0]}”:

<a class="fancybox nohover" href="/my/ajax/url/${account[0]}" data-fancybox-type="ajax"     id="accountReportView_${account[0]}"> </a>    

The day after I got this working, I realised that I needed to add a “random number”, as IE was caching the result from Ajax get request.  I added the following:

This creates a random number (?cache).

Author | Miles Davenport

Career programmer, who designs, assembles, fixes, and supports customers, software and systems.