<html>
<head>
<title> jQuery.globalEval Delayed in Firefox </title>
</head >
<body>
<h1> jQuery.globalEval Delayed By Inserted Scripts </h1>
<p>
Time taken: <b id=timetaken></b>
</p>
<hr/>
<p>
A globalEval() script will be called and insert the duration between the call to globalEval() and the execution of the script. Immediately prior to the globalEval() call, a dynamic script will also be inserted that takes two seconds to complete.
</p>
<p>
Since Firefox executes scripts in the order in which they're inserted, the time taken will be ~5 seconds. All other browsers will execute the script synchronously.
JavaScript
var
startTime= window.startTime= Number (new Date),
delayed= document.createElement("script"),
global= "time= Number(new Date) - startTime; ; $('#timetaken').html(time + 'ms') ",
delayUrl= 'http://a.ec2-1.digital-fulcrum.com/?delay=5&x-async=false&x-order=1&cache-control=no-cache'
;
delayed.src= delayUrl;
document.body.appendChild( delayed );
jQuery.globalEval(global);
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.