First, thanks for your reply Rob.
Second, i will tell you the truth.
What i need is to access strings out of my server and include it on my
html.
I thougth in puting this strings on a text fileld of an style and
access it.
Why?
I can't use <scripts src="
http://..."> because of security risk.
I don't really understand what you are doing. Presumably a server
is generating strings for some purpose and putting them in a
file. Do you then want the browser to be able to securely access
the same file?
Maybe your best option is to investigate XMLHTTP - do a search on
this newsgroup and post anew for more help.
So, i am trying to include an accessable and not runable code on my
html.
Why not use a meta tag? e.g.
<meta name="aStringOfText" content="blah blah blah">
Then use document.getElementsByTagName('meta') to get at it?
var c = document.getElementsByTagName('meta')['aStringOfText']
alert(c.content); // blah blah blah
With appropriate feature detection added. Of course, then the
user will see the content in the HTML source, so this may raise
your security issues again.
I know that ActiveX do it and java too but for compatibility reasons i
prefered css.
If you get this to work via CSS I think that's called a hack
or kludge.
Tried your code:
document.styleSheets[0].cssRule[0].style.cssText
works on Nescape but not in IE.
Yeah, sorry, the IE equivalent is:
document.styleSheets[0].rules[0].style.cssText
More IE stuff is here:
<URL:
http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_stylesheet.asp>
You need to use feature detection to sort which method to use (IE
or other). And IE 6 seems to have dropped the leading '*' on
selectorText.
The equivalent w3c spec is here:
<URL:
http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS-CSSStyleSheet-cssRules>