So I am trying to work out the differences between
link.click()
and
var event = document.createEvent("MouseEvents");
event.initEvent("click", true, false);
link.dispatchEvent(event);
As far as I can tell these should be the same things (however working with my jsfiddle example of exporting a csv from a URI this is not the case as they perform differently from browser to browser)
Using .click() with firefox the popup to download the csv will not show (it will in chrome)
see example -> http://jsfiddle.net/a5E9m/23/
Where as using the Mouse events it will
see example -> http://jsfiddle.net/a5E9m/25/