इम इस समारोह को लागू करने के सीएसएस (एक पाठ चर का उपयोग कर) के साथ समस्या हो इंटरनेट एक्सप्लोरर के साथ काम करने के साथ काम करता है, लेकिन यह फ़ायरफ़ॉक्स & क्रोम में काम करता है।नियंत्रित सीएसएस मोज़िला और क्रोम लेकिन नहीं IE
/*! 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);
}/*___________________________________________________________________________*/
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
तुम क्यों इस तरह सीएसएस जोड़ना चाहते हैं? –
@ केन अच्छी तरह से सर्वर पर प्रत्येक फ़ाइल अनुरोध अलग फ़ाइलों की तुलना में सर्वर पर अधिक कर लगा रहा है। इसके अलावा मैं ऊब गया था। – GlassGhost
मुझे खुशी है कि यह एक दिलचस्प सवाल है; अन्यथा, मैं सिर्फ "प्लस, मैं ऊब गया था" के लिए इसे ऊपर उठाने का लुत्फ उठाऊंगा। :- डी –