Hello,
I am having difficulty with character sets in a new child window opened by a Javascript function. Though the meta content-type tag is set just like in the parent window, the child window charset reverts to the browser default. The meta tag setting shows in the child-window source and in the firefox page info for the child-window, but it doesn't affect the browser setting for that window. I assume the browser is ignoring the meta tag, but I don't know why..
One page affected is at
Just click the vocabulary list button, and then compare the charset in each window.
It runs on the following code:
Verbose, I know. I hope to concat the whole thing into one simple string, and write that to the window at once. Is document.write() the problem? Why is the meta tag being ignored by the browser?
Thanks for any help,
-Kevin
I am having difficulty with character sets in a new child window opened by a Javascript function. Though the meta content-type tag is set just like in the parent window, the child window charset reverts to the browser default. The meta tag setting shows in the child-window source and in the firefox page info for the child-window, but it doesn't affect the browser setting for that window. I assume the browser is ignoring the meta tag, but I don't know why..
One page affected is at
Just click the vocabulary list button, and then compare the charset in each window.
It runs on the following code:
Code:
var vocabWin=window.open('',"_blank","menubar=no,width=400,height=600,scrollbars=yes,resizable=yes");
var listStr="foreign language vocabulary goes here";
var charset="<?php echo $charset; ?>";
vocabWin.document.open();
vocabWin.document.write('<html>');
vocabWin.document.write('<head><meta http-equiv="Content-Type" content="text/html; charset=');
vocabWin.document.write(charset);
vocabWin.document.write('">');
vocabWin.document.write('<title>Vocabulary List</title>');
vocabWin.document.writeln('</head><body>');
//vocabulary list stuff clipped
vocabWin.document.write('</body></html>');
vocabWin.document.close();
Verbose, I know. I hope to concat the whole thing into one simple string, and write that to the window at once. Is document.write() the problem? Why is the meta tag being ignored by the browser?
Thanks for any help,
-Kevin