spunog
asked on
Layer messes up other text on screen
Greetings,
I have a layer which I use to display some text. When the layer is changed to visibility = 'show' then if I move another window in front of netscape all the other text on the page gets changed to : [][][][][] . The text in the Layer is not affected . I am using NS4.75 . Whats the Spiel with this ?
Cheersw
Spunog
I have a layer which I use to display some text. When the layer is changed to visibility = 'show' then if I move another window in front of netscape all the other text on the page gets changed to : [][][][][] . The text in the Layer is not affected . I am using NS4.75 . Whats the Spiel with this ?
Cheersw
Spunog
ASKER
The encoding is set as follows:
<%@ page errorPage="SimpleErrorPage .jsp"
contentType="text/html; charset=UTF-8"session="tru e"
buffer="1kb"%>
The layer is very simple :
<LAYER id="errorMessage" align="left" style="width:600px; position:relative; visibility: hidden "> </LAYER>
Then I write html to the layer from javascript as follows :
document.errorMessage.docu ment.open( );
document.errorMessage.docu ment.write ("<table border='0' cellspacing='0' cellpadding='0' width='585' summary='This table is used for layout only.'><tr><td><br></td></ tr><tr><td ><font color='#FF0000'><getString :getString stringId="duplicationerror "/></font> </td></tr> </table>") ;
document.errorMessage.docu ment.close ();
document.errorMessage.visi bility = 'show';
<%@ page errorPage="SimpleErrorPage
contentType="text/html; charset=UTF-8"session="tru
buffer="1kb"%>
The layer is very simple :
<LAYER id="errorMessage" align="left" style="width:600px; position:relative; visibility: hidden "> </LAYER>
Then I write html to the layer from javascript as follows :
document.errorMessage.docu
document.errorMessage.docu
document.errorMessage.docu
document.errorMessage.visi
ASKER
The encoding is set as follows:
<%@ page errorPage="SimpleErrorPage .jsp"
contentType="text/html; charset=UTF-8"session="tru e"
buffer="1kb"%>
The layer is very simple :
<LAYER id="errorMessage" align="left" style="width:600px; position:relative; visibility: hidden "> </LAYER>
Then I write html to the layer from javascript as follows :
document.errorMessage.docu ment.open( );
document.errorMessage.docu ment.write ("<table border='0' cellspacing='0' cellpadding='0' width='585' summary='This table is used for layout only.'><tr><td><br></td></ tr><tr><td ><font color='#FF0000'><getString :getString stringId="duplicationerror "/></font> </td></tr> </table>") ;
document.errorMessage.docu ment.close ();
document.errorMessage.visi bility = 'show';
<%@ page errorPage="SimpleErrorPage
contentType="text/html; charset=UTF-8"session="tru
buffer="1kb"%>
The layer is very simple :
<LAYER id="errorMessage" align="left" style="width:600px; position:relative; visibility: hidden "> </LAYER>
Then I write html to the layer from javascript as follows :
document.errorMessage.docu
document.errorMessage.docu
document.errorMessage.docu
document.errorMessage.visi
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Removing it altogether doesn't fix it. Ho do I set the layer to use a specific encoding ?
Thanks
Spunog
Thanks
Spunog
ASKER
Removing it altogether doesn't fix it. Ho do I set the layer to use a specific encoding ?
Thanks
Spunog
Thanks
Spunog
You can place header information into a layer, although I will have to double check to see if there is a more "proper" way.
Is this whole page being generated by a scripting language, or just your header information? Try placing everything in a flat .html, with no code other then JavaScript, and see what happens.
Does that layer and/or main document contain any Unicode characters?
Is this whole page being generated by a scripting language, or just your header information? Try placing everything in a flat .html, with no code other then JavaScript, and see what happens.
Does that layer and/or main document contain any Unicode characters?
ASKER
Is a layer treated as a totaly separate html source , therefore the meta tags on the page are not available to the layer ? sound crazy ?
ASKER
The ISO-8859-1 works fine but unfortunately it must be UTF-8 . So I need to know how to set the charset of a layer.
try:
<SCRIPT LANGUAGE='JavaScript'>
theObj = getElementById('layername' );
theObj.setAttribute('encod ing', 'UTF-8');
</SCRIPT>
... this is assuming your using Gecko (Mozilla or Navigator 6+). I am not sure if IE actually supports the standardized DOM yet.
I'm not sure if "encoding" is the right either. Try "charset" too if it doesn work. I'll have to do some more digging to figure out if an Element even has the appropriate attribute.
<SCRIPT LANGUAGE='JavaScript'>
theObj = getElementById('layername'
theObj.setAttribute('encod
</SCRIPT>
... this is assuming your using Gecko (Mozilla or Navigator 6+). I am not sure if IE actually supports the standardized DOM yet.
I'm not sure if "encoding" is the right either. Try "charset" too if it doesn work. I'll have to do some more digging to figure out if an Element even has the appropriate attribute.
ASKER
So should that be put within the layer tags ??
No.
Try it at the bottom of your document, to make sure everything has loaded.
Try it at the bottom of your document, to make sure everything has loaded.
ASKER
This actually worked but not for me in the way I needed. The problem was that Netscape does not like document.write to a layer or whatever so I made a bunch of em with all possible text and basically just hide em or make em appear when appropriate. Thanks a lot buddy you have been very helpfull.....
Spunog
Spunog
Um... hm... erm...
What the browser's encoding set to (language)? Are you putting different text encodings into the layer then what is in the main document?