I often use a construct like this:

main.html
<div id="placeForJS"></div>

function loadInit () { .. ajax call to stuff things into placeForJS-
div .. }
..
..
inline javascript call to function loadinit ()


This works fine. But sometimes (and I can't find the pattern), the
stuff returned by the ajax.updater call into the placeforJS div, isn't
available to the javascript also returned by the call. I use
evalscripts:true, and the javascript itself executes fine. But I can't
seem to access stuff at times.

For example, in load.php (called by Ajax.Updater ()), I return

<.. javascript code ..
     reload = function () { }

     validate = function () {
         Here I access the tlf0 form, and its fields
     .. >

<form name="tlf0" id="tlf0" ...>
  <input ..>
  <input type="button" onclick="validate();void(0)" name="ok"
value="OK" />
</form>

So this is stuffed into the placeForJS-DIV. And it works on the first
initial page load, but when I click the OK-button, I get a JS-error
claiming tlf0 has no properties..

Why?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to