JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 18th, 2002, 12:16 AM
sunnychan's Avatar
sunnychan sunnychan is offline
a lazy guy
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Location: Hong Kong
Posts: 99 sunnychan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Javascript: Charset

I have a html file START.HTML which will create two frames at the very begining.
eg.
--------------------------------------------------------------------
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</HEAD>
<FRAMESET COLS="250,*" frameborder="NO" framespacing="0" border="0" onload="start()">
<FRAME NAME="treeFrame" SRC="../html_big5/preload.html" frameborder="Yes" noresize SCROLLING="Auto">
<FRAME NAME="pageFrame" SRC="../html_big5/preload.html" SCROLLING="Auto" noresize>
<noframes>
</noframes>
</frameset>
</html>
--------------------------------------------------------------------

as you can see, the frameset will execute a function start() after the creation of frames.
the preload.html is indeed a very simply html like this:
--------------------------------------------------------------------
<HTML>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
<BODY BGCOLOR='#FFFFFF'>
</BODY>
</HTML>
--------------------------------------------------------------------

note that both START.HTML and preload.html are assigned the charset BIG5.
Now, the function start() will start writing html to the frame treeframe:

eg.
----------------------------------------------------------------------
outputFrame = top.treeFrame.window.document; outputFrame.writeln("<HTML>");
outputFrame.writeln("<HEAD>");
outputFrame.writeln("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=big5\"/>");
outputFrame.writeln("<HEAD>");
...
...
...

----------------------------------------------------------------------

The frame 'treeframe' is using the charset 'iso-8859-1' instead of 'big5'. Anyone know what cause the problem?

Im using Netscape 4.7.

Reply With Quote
  #2  
Old April 18th, 2002, 02:04 AM
sunnychan's Avatar
sunnychan sunnychan is offline
a lazy guy
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Location: Hong Kong
Posts: 99 sunnychan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
a simple example

here is a more simple example.
the following code cannot print the 'big5' chars correctly in netscape 4.7

note: preload.html is a blank html
----------------------------------------------------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<script>
function test()
{
var aliasUrl = "preload.html";
AliasPopUpWin = window.open(aliasUrl,'docAliasWin','toolbar=no,location=no,scrollbars=yes,status=no,width=400,height =500');

outputFrame = top.AliasPopUpWin.window.document;
outputFrame.charset="big5";
outputFrame.open("text/html");
outputFrame.write("<HTML>\n");
outputFrame.write("<HEAD>\n");
outputFrame.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=big5\">\n");
outputFrame.write("</HEAD>\n");
outputFrame.write("§Ö¹ÏÀÉ\n");
outputFrame.write("</HTML>\n");
outputFrame.close();
}
</script>
</head>
<a href="javascript:test()">tesT</a>
</html>

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Javascript: Charset


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT