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.

> Yes, I am stuck in ASP.NET for this project.

My sympathies are with you. :0

-Daniel Elmore


-----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

Reply via email to