Skip to content

Instantly share code, notes, and snippets.

@silverjam
Created November 19, 2010 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save silverjam/706066 to your computer and use it in GitHub Desktop.
Save silverjam/706066 to your computer and use it in GitHub Desktop.
Example of jQuery.click not working.
// Tested on http://blip.fm/home page
// Works
(function() {
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window,
0, 0, 0, 0, 0, false, false, false, false, 0, null);
var cb = document.getElementById("prevPageLinkTop");
cb.dispatchEvent(evt);
})()
// Doesn't work
jQuery("#prevPageLinkTop").click()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment