X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=build%2Fruntest%2Ftestrunner.js;h=363cd9bd9b68956e1ab701bbf691c187846ffb83;hb=d776dc9d5c5322e81b56272728325990ed6892bb;hp=97441001269a35bbf4ec7c4940dbe022bfcfa98d;hpb=89a9a747b603ae21945aa0cbcdf13560d3e7cea1;p=jquery.git diff --git a/build/runtest/testrunner.js b/build/runtest/testrunner.js index 9744100..363cd9b 100644 --- a/build/runtest/testrunner.js +++ b/build/runtest/testrunner.js @@ -160,4 +160,38 @@ function results(){ } function start(){} -function stop(){} \ No newline at end of file +function stop(){} + +/** + * Trigger an event on an element. + * + * @example triggerEvent( document.body, "click" ); + * + * @param DOMElement elem + * @param String type + */ +function triggerEvent( elem, type, event ) { +/* + if ( jQuery.browser.mozilla || jQuery.browser.opera ) { + event = document.createEvent("MouseEvents"); + event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView, + 0, 0, 0, 0, 0, false, false, false, false, 0, null); + elem.dispatchEvent( event ); + } else if ( jQuery.browser.msie ) { + elem.fireEvent("on"+type); + } +*/ +} + +/** + * Add random number to url to stop IE from caching + * + * @example url("data/test.html") + * @result "data/test.html?10538358428943" + * + * @example url("data/test.php?foo=bar") + * @result "data/test.php?foo=bar&10538358345554" + */ +function url(value) { + return value + (/\?/.test(value) ? "&" : "?") + new Date().getTime() + "" + parseInt(Math.random()*100000); +} \ No newline at end of file