Ticket #6024 (closed bug: invalid)
.getScript() works incorrectly with strings
| Reported by: | Xaver | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.4.2 |
| Component: | unfiled | Version: | 1.4.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
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.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

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.