Skip to content

scope [undefined] not an object in Safari #1

Description

@GoogleCodeExporter
What steps will reproduce the problem?
Sid.js("js/ajax.js", function() {
     var connection = initConnection();
}); 

What is the expected output? What do you see instead?
I get an error in the console saying that scope is not an object.

I don't know why by the inline if statement that sets the scope object doesn't 
seem to be working in Safari (Mac). In Chrome it works just fine.

I got rid of the vars, and changed the scope line to the line below, and all is 
well.

        scope = (scope ? (
            scope == 'body' ? document.getElementsByTagName('body')[0] : document.getElementsByTagName('head')[0]) : 
            (type == 'js' ? document.getElementsByTagName('body')[0] : document.getElementsByTagName('head')[0]));

Great little piece of code.. needed it to get by the FF3 problem with 
$.getScript() in jQuery.



Original issue reported on code.google.com by ale...@gmail.com on 12 Mar 2011 at 8:13

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions