Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
90
rated 0 times [  93] [ 3]  / answers: 1 / hits: 19645  / 10 Years ago, fri, february 21, 2014, 12:00:00

How can I load a JavaScript with this code



<script type=text/javascript src=http://uads.ir/l.php?s=125125&w=5307cd5c027373e1773c9869></script>


after page has loaded



$(document).ready(function() 
{

});


Is there another way?


More From » jquery

 Answers
60

Try appending the script to the head section: (Working jsFiddle)



$(document).ready(function(){
$('<script/>',{type:'text/javascript', src:'http://uads.ir/l.php?s=125125&w=5307cd5c027373e1773c9869'}).appendTo('head');
});


EDIT: I like this syntax better..


[#72382] Thursday, February 20, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
brennonr

Total Points: 124
Total Questions: 101
Total Answers: 101

Location: Estonia
Member since Wed, Jun 8, 2022
2 Years ago
;