Bug 15224 - JavaScript loaded via Prototype.js isn't evaluated
Summary: JavaScript loaded via Prototype.js isn't evaluated
Status: RESOLVED DUPLICATE of bug 10370
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-17 05:21 PDT by Alexey Blinov
Modified: 2007-09-24 10:31 PDT (History)
3 users (show)

See Also:


Attachments
test case (23.03 KB, application/zip)
2007-09-19 03:02 PDT, Alexey Proskuryakov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Blinov 2007-09-17 05:21:38 PDT
Loading data using prototype.js

<script>
  new Ajax.Updater('section_data', 'veil.html', {method:'get', evalScripts: true});
</script>

--- veil.html (works fine) -------------
<p>This alert shows up just fine</p>
<script type="text/javascript" charset="utf-8">
  alert('Hello!');
</script>

--- veil.html (didn't work) -------------
<p>This alert didn't fire up. And all script block didn't executed/eval'd</p>
<script type="text/javascript" charset="utf-8">
  alert('Привет!'); //<- any utf-8 (russian in my case) text
</script>

--- veil.html (didn't work too!) -------------
<p>This alert didn't fire up. And all script block didn't executed/eval'd</p>
<script type="text/javascript" charset="utf-8">
  alert('Hello!');
  //коментарий <- any utf-8 (russian in my case) comment
</script>

-------------------------------------
Code above works in FireFox 2.0.0.6 (Mac), Opera 9.21 (Mac)
Didn't works in Safari 2.0.4 (419.3), WebKit (25552, 25585)

P.S.
Eval something like code in the next few line works fine. Mean eval code with russian without loading it via AJAX/Prototype.js requests
<script>
  eval('alert("привет!")');
</script>
Comment 1 David Kilzer (:ddkilzer) 2007-09-18 09:23:03 PDT
Thanks for the bug report, Alexey.  Which version of Prototype.js are you using?

Comment 2 David Kilzer (:ddkilzer) 2007-09-18 09:29:40 PDT
Also, what content type does your web server use to serve the original page (with prototype.js included) as well as each of the veil.html examples?  (The output of "curl -I URL" would be helpful.)

Comment 3 Mark Rowe (bdash) 2007-09-18 15:08:47 PDT
A live URL demonstrating the issue would also help investigating this.
Comment 4 Alexey Blinov 2007-09-19 01:35:47 PDT
Prototype.js is 1.5.1.1
"curl -I URL" result
-----------------
$ curl -I http://itportal/visual_service/
HTTP/1.1 200 OK
Date: Wed, 19 Sep 2007 08:35:27 GMT
Server: Apache/2.0.55 (Ubuntu) mod_python/3.2.8 Python/2.4.4c1
Vary: Cookie
Content-Type: text/html; charset=utf-8


And i can't give you a live URL - its WIP
Comment 5 Alexey Proskuryakov 2007-09-19 03:02:48 PDT
Created attachment 16324 [details]
test case
Comment 6 Alexey Proskuryakov 2007-09-19 03:04:42 PDT
Confirmed with shipping 10.4.8 Safari/WebKit and with r25261. Still needs a reduction.
Comment 7 Alexey Proskuryakov 2007-09-19 03:53:07 PDT
This has the same root cause as bug 10370.

*** This bug has been marked as a duplicate of 10370 ***
Comment 8 Alexey Proskuryakov 2007-09-24 10:31:39 PDT
Filed <http://dev.rubyonrails.org/ticket/9663>, hoping that a workaround can be implemented in Prototype.js.