Skip to content

async injectScript #46

@ghost

Description

In this function

function injectScript(src){
var s, t;
s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = src;
t = document.getElementsByTagName('script')[0];
t.parentNode.insertBefore(s,t);
}

t is currently 'Undefined' so I cannot get the parentNode of it.

I am trying to use it like this

define([ 'jquery', 'jasmineJquery', 'require', 'async!http://maps.google.com/maps/api/js?sensor=false'], function(){
describe("Google test", function () {
it("should not throw exception ", function () {
.................
})
})
});

and run using sbt jasmine command

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions