Note that there are some explanatory texts on larger screens.

plurals
  1. POcontrolling css with javascript works with Mozilla & Chrome but not IE
    text
    copied!<p>Im having problems with this function applying css(using a text variable) working with Internet Explorer but it works in Firefox &amp; Chrome.</p> <p><a href="https://github.com/GlassGhost/Glas-Test-Area/blob/master/addCssStyle.js" rel="nofollow noreferrer">the code:</a></p> <pre><code>/*! addCssStyle() applies the text value $CssText$ to the the specified document $Doc$ e.g. an IFrame; or if none specified, default to the current document, */function addCssStyle(CssText, Doc){ //Secure $Head$ for the current $Doc$ Doc = Doc||document; var head = Doc.getElementsByTagName('head')[0]; if(!head || head == null){ head = Doc.createElement('div'); Doc.body.appendChild(head); } if(!head || head == null){return false;} //createElement('style') var PendingStyle = Doc.createElement('style'); // if (is_gecko){PendingStyle.href = 'FireFox.css';}//???needeed??? PendingStyle.type = 'text/css'; PendingStyle.rel = 'stylesheet'; // PendingStyle.media = 'screen';//???needeed??? PendingStyle.innerHTML = CssText; head.appendChild(PendingStyle); }/*___________________________________________________________________________*/ </code></pre> <p><a href="http://en.wikipedia.org/wiki/User:GlasGhost/Encyclopedia_feel_User_skin" rel="nofollow noreferrer">the use of the function:</a></p> <pre><code>var NewSyleText = //The page styling "h1, h2, h3, h4, h5 {font-family: 'Verdana','Helvetica',sans-serif; font-style: normal; font-weight:normal;}" + "body, b {background: #fbfbfb; font-style: normal; font-family: 'Cochin','GaramondNo8','Garamond','Big Caslon','Georgia','Times',serif;font-size: 11pt;}" + "p { margin: 0pt; text-indent:2.5em; margin-top: 0.3em; }" + "a { text-decoration: none; color: Navy; background: none;}" + "a:visited { color: #500050;}" + "a:active { color: #faa700;}" + "a:hover { text-decoration: underline;}"; addCssStyle(NewSyleText);//inserts the page styling </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload