I see.
Have you tried passing Javascript that would load an external file? I
mean, rather than passing <script src="..."></script>, passing
something like the following:
<script type="text/javascript">
function loadJs (fileName) {
var head = document.getElementsByTagName("head")[0];
var s = document.createElement('script');
s.type = 'text/javascript';
s.src = fileName;
head.appendChild(s);
}
loadJs('/js/someFile.js');
</script>
TAG
On Jul 13, 2007, at 11:03 AM, James Starmer wrote:
>
> Tom,
> That didn't really help, thanks though. The .update (aka
> Element.update) calls evalScripts.
>
>> From the api http://www.prototypejs.org/api/element/update :
> "If it contains any <script> tags, these will be evaluated after
> element has been updated (Element.update internally calls
> String#evalScripts)."
>
> So using Ajax.Updater vs. Ajax.Request isn't the issue.
>
> I don't have trouble with evalScripts handling scripts that are in the
> page being fetched by ajax. My problem is when that page includes a
> separate javascript file like <script src="whatever.js"></script>.
> evalScripts doesn't handle those.
>
> It's more of a prototype design question than a help me with this bug
> question because I don't think it's a bug.
>
> Thanks,
> James Starmer
>
> On Jul 13, 11:41 am, Tom Gregory <[EMAIL PROTECTED]> wrote:
>> Looks like you may actually want Ajax.Updater, which has an
>> evalScripts option.http://prototypejs.org/api/ajax/updater
>>
>> new Ajax.updater(tab.linkedPanel, url, {
>> //method: 'post', //Is already default method
>> //parameters: Form.serialize('formId'), //Do you need to pass any
>> parameters?
>> evalScripts: true
>>
>> });
>>
>> Does that work for you?
>>
>> TAG
>>
>> On Jul 13, 2007, at 9:28 AM, James Starmer wrote:
>>
>>
>>
>>> new Ajax.Request(url,{
>>> method: 'post',
>>> onComplete: function(transport) {
>>> tab.linkedPanel.update
>>> (transport.responseText);
>>> }
>>> });
>>
>>> tab.linkedPanel is an empty <div>.
>>
>>> On Jul 13, 10:41 am, Diodeus <[EMAIL PROTECTED]> wrote:
>>>> Please post the code for your ajax call.
>>
>>>> On Jul 12, 5:10 pm, James Starmer <[EMAIL PROTECTED]> wrote:
>>
>>>>> Hello everyone,
>>>>> Here is my problem. I have a page that gets fetched by an ajax
>>>>> request. I have
>>
>>>>> onComplete: function(transport) {
>>>>> $('element').update(transport.responseText);
>>
>>>>> }
>>
>>>>> The update in turn calls evalScripts and runs all of the
>>>>> javascript
>>>>> inside of script (<script></script>) tags, but I also have linked
>>>>> javascript files (<script src="whatever.js"></script>) in the
>>>>> requested page that evalScripts doesn't handle.
>>
>>>>> I'm just wondering why prototype doesn't handle these included
>>>>> scripts? Is it a conscious design decision?
>>
>>>>> Thanks,
>>>>> James Starmer
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---