What is the Alternative to $.getScript?

Do you know the alternative to $.getScript?  I need another way of executing this line $.getScript('http://platform.twitter.com/widgets.js'); without using $.getScript

Thanks,

Dan
danielolorenzAsked:
Who is Participating?
 
leakim971PluritechnicianCommented:
>without using $.getScript

if you've jQuery in the box why ?
do
a simple one :

var myscript = document.createElement("script");
myscript.type = "text/javascript";
myscript.language = "javascript";
myscript.url = "http://platform.twitter.com/widgets.js'";
document.body.appendChild(myscript);

Open in new window

0
 
StingRaYCommented:
$.ajax({
  url: <url>,
  dataType: "script",
  success: <function>
});

Open in new window


For more detail, see: http://api.jquery.com/jQuery.getScript/
0
 
rbgCODECommented:
You could try using jQuerys script + load function instead of the $.getScript  but loading with getscript opens it in a better fashion and asynchronously, is there a reason you don't want to use the getScript function?
0
 
danielolorenzAuthor Commented:
Thanks that was exactly what I needed
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.