How To Simulate Script injectionLet's say you want a test but you don't want to bother a server. However, you want to be sure the test is asynchronous and it simulates the server.
head = document.getElementsByTagName("head"),
script = document.createElement("script")
How To Simulate JSONPSame trick, isn't it? ... except:
"callback(" + JSON.stringify(dummyData) + ")"
How To Drop Server Requestswell, this is the tricky one ...
Surely there is some job to do in the createResponse() function but ... hey, we can stop bothering servers now ;)