javascript - Why doesn't a console loaded script have access to the DOM? -


i added script dom using

// in console of facebook.com  var test = document.createelement('script'); test.src = "foo"; document.head.appendchild(test); 

but script has no access dom.

does have same origin policy?

here working solution add jquery:

var jq = document.createelement('script'); jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; document.getelementsbytagname('head')[0].appendchild(jq); jquery.noconflict(); 

Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -