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
Post a Comment