|
This thread is locked; no one can reply to it. |
1
2
|
XmlHttpRequest and friends |
Matthew Leverton
Supreme Loser
January 1999
|
Are you sure it's truncated, or is the alert box just not displaying it all? Quote: alert() doesn't have troubles with accented letters. No, but the encoding might get lost. How is it encoded on the server? UTF-8? If so, you'll need to convert them to JS's "\u1234" format. As a quick hack, you could use PHP's utf8_decode() function, but that will only help for chars < 256. |
Marco Radaelli
Member #3,028
December 2002
|
Quote: Are you sure it's truncated, or is the alert box just not displaying it all?
I guess so, because if I use eval() IE pops up an error saying 'Unterminated string...'. To sum it up I have two drop-down menus. The content of the latter depends on the selected item of the former. When an element is selected, I delete all the content of the former <select> with select = document.getElementById('comune'); for(i = 0; i < select.options.length; i++) select.remove(i); This works when it contains only one element, but fails if its content has been filled through the javascript server-generated. I'm investigating it, any idea? Quote: No, but the encoding might get lost. How is it encoded on the server? UTF-8? If so, you'll need to convert them to JS's "\u1234" format. As a quick hack, you could use PHP's utf8_decode() function, but that will only help for chars < 256.
Resolved , I just made the php script output the charset along with the content type in the HTTP Response header [edit] Wohoo this is the way to remove all the <option>s while(select.options.length) select.remove(0); not this for(i = 0; i < select.options.length; i++) select.remove(i);
|
|
1
2
|