searle Posted March 13, 2012 Posted March 13, 2012 I am looking to insert a new script node into the head element within IE, although I'm not sure how best to go about approaching this. My thought process was as follows: $oHead = $oIE.document.body.GetElementsByTagName('head') $oHead = $oHead[0] ; takes first element, which should be the only one returned $oScriptNode = $oIE.document.body.createElement('script') ; fill script node element with text $oHead.appendChild($oScriptNode) That is more pseudo-code than anything at this point, but it's my starting point. Does anyone have any suggestions on how to proceed?
searle Posted March 13, 2012 Author Posted March 13, 2012 (edited) And right after I posted this, I solved my own problem: dim $def = "body {background-color: red;}" dim $oHead = $oExplorer.document.getElementsByTagName('head')(0) dim $oStyle = $oExplorer.document.getElementsByTagName('head')(0) $style.setAttribute("type", "text/css") $style.styleSheet.cssText = $def $oHead.appendChild($style) Edited March 13, 2012 by searle
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now