On Apr 18, 2006, at 4:05 PM, Daniel Elmore wrote:

I just got done debugging my evalScripts calls and the test = function()
style JS did not work in IE. I had to simplify it to:

<script type="text/javascript">alert("test");</script>

That method worked in IE and FF.

I'm working in FF for right now. Incidentally, I tried the above code before and it didn't work. It's like the scripts aren't being evaluated at all.

I have one more block of code above that script block, so in effect two script blocks must be evaluated. It looks like the first one is being evaluated, but I'm not sure.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Brad
Ediger
Sent: Tuesday, April 18, 2006 3:58 PM
To: [email protected]
Subject: [Rails-spinoffs] [Prototype] evalScripts not working for me

I think I am experiencing the variable scope problem with evalScripts.

I have this block of code being returned from an Ajax.Updater call, as shown by FireBug or one of those other Firefox plugins. I have tried to boil it
down to the minimum code.

<script type="text/javascript">
test = function() { alert("test"); };
</script>

<table class="small_input" id="edit_table_279">
--SNIP--
</table>

<input type="button" onclick="test();" value="test" />

Clicking the "test" button pops a "test is not defined" error. This is
basically the same code that is in the example
at http://www.sergiopereira.com/articles/prototype.js.html so I don't know
what I'm doing wrong.

Here is how I call Ajax.Updater:

new Ajax.Updater(updateDiv, "Profile/update.aspx", {
                        asynchronous: true,
                        parameters: params,
                        evalScripts: true,
                        onComplete: function() { refresh_columns(); }
});

Yes, I am stuck in ASP.NET for this project. :-(
--
Brad Ediger
866-EDIGERS




_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to