Convert array to JSON

Script for backward-compatibility: https://github.com/douglascrockford/JSON-js/blob/master/json2.js And call: Note: The JSON object is now part of most modern web browsers (IE 8 & above). See caniuse for full listing. Credit goes to: @Spudley for his comment below

Reload an iframe with jQuery

If the iframe was not on a different domain, you could do something like this: But since the iframe is on a different domain, you will be denied access to the iframe’s contentDocument property by the same-origin policy. But you can hackishly force the cross-domain iframe to reload if your code is running on the iframe’s parent page, … Read more

Changing the image source using jQuery

You can use jQuery’s attr() function. For example, if your img tag has an id attribute of ‘my_image’, you would do this: Then you can change the src of your image with jQuery like this: To attach this to a click event, you could write: To rotate the image, you could do this: