Side navigation
#6024 closed bug (invalid)
Opened February 04, 2010 11:03AM UTC
Closed February 04, 2010 01:35PM UTC
.getScript() works incorrectly with strings
Reported by: | Xaver | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.4.2 |
Component: | unfiled | Version: | 1.4.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Example1:
<!doctype html><html><head>
<script type="text/javascript" src="jquery.js"></script>
</head><body>
<script>
$.getScript("strings.js"); /* strings.js contains localized strings only */
document.write(str0); /* str0="str0. Строка на русском" */
document.write('<br>');
document.write(str1); /* str1="str1. A string in English" */
</script></body></html>
In this case IE displays only latin chars, but FF3.5 and Opera 10 display nothing.
Though when used with "success()" it works in another way, but incorectly too.
Example2:
<!doctype html><html><head>
<script type="text/javascript" src="jquery.js"></script>
</head><body>
<script>
$.getScript("strings.js", function(){
document.write(str0); /* A string in Russian */
document.write('<br>');
document.write(str1); /* A string in English */
});
</script></body></html>
In this case IE displays only latin chars, but FF3.5 displays some trash instead of russian chars and Opera 10 display correctly, but is slow.
Attachments (0)
Change History (2)
Changed February 04, 2010 11:04AM UTC by comment:1
Changed February 04, 2010 01:35PM UTC by comment:2
resolution: | → invalid |
---|---|
status: | new → closed |
Shouldn't your page probably have a charset specified - likely UTF-8? Not specifying one will result in malformed UTF-8 characters (as you're noticing).
And one more. Cannot load files that are higher up in the local folder hierarchy. Works fine for absolute paths and relative paths that are at level or lower.