Can jQuery create <script> node?
Hi all,
I am doing a research on ajax using jQuery. IMO, a good ajax aplication should implement "lazy loading" technique by loading script on-demand. In jQuery i use $.getScript() to fetch javascript codes. But, it becomes strange that jQuery can't make <script> node to attach the new script. Here is my code:
-
$.getScript("myscript.js", function(data){
$("head").append("<script>" + data + "</script>");
});
Any suggestions?