/    Sign up×
Community /Pin to ProfileBookmark

$.getScript Won’t work in IE

I have this script and it works fine in FF, Chrome, Opera, and Safari but will not work in IE can someone show me what I am missing:

[CODE]<script language=”javascript” type=”text/javascript” src=”https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js”></script>

<script language=”javascript” type=”text/javascript”>
<!–
$(document).ready(function(){
var isiPad = navigator.userAgent.match(/iPad/i) != null;
var isiPod = navigator.userAgent.match(/iPod/i) != null;
var isiPhone = navigator.userAgent.match(/iPhone/i) != null;
if(isiPad||isiPod||isiPhone)
{
$.getScript(“http://www.myvideocode.com/iphone/test_adplib.js”);
$.getScript(“http://www.myvideocode.com/iphone/test.js”);
}
else
{
$.getScript(“http://www.myvideocode.com/client/steelbeach020812b/video-code_adplib.js”);
$.getScript(“http://www.myvideocode.com/client/steelbeach020812b/video-code.js”);
}
});
–>
</script>[/CODE]

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@aj_nscFeb 19.2012 — 
  • 1. language="javascript" is deprecated. Use type='text/javascript' only. If you're using a HTML5 doctype (<!doctype html>) you don't even need to use type='text/javascript' as this is automatically assumed.


  • 2. You don't need to put the contents of embedded JavaScript in comment (<!-- -->) tags, remove them.


  • 3. If fixing the above 2 issues hasn't solved your problem, tell us what JavaScript error you're getting. (Push F12 and then click console, then reload your page and you should see a JavaScript error show up in the console).


  • Do you know the $.getScript isn't working (i.e. the script isn't getting requested) or is it that IE encounters an error in (one of) the scripts that are loaded?
    ×

    Success!

    Help @mlobrutto spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.17,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @nearjob,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...