Hello all,
I have a script that uses a Ajax.Updater call to update the contents
of a DIV. The code being inserted includes a javascript function,
which is "called" by onClick event elsewhere in the HTML.
The page initially works fine in that the DIV gets the right content,
the Javascript inserted works fine.
The problem I have is that if I call the Ajax.Updater again then the
javascript in the second call does not seem to "refresh" that in the
first call.
The Javascript has something along the lines of :
<script type="text/javascript">
splitInfo = function(splitNumber) {
var splitJSON = <? echo json_encode($m_array); ?>;
var latlng1 = new GLatLng(splitJSON.data[splitNumber].start_lat,
splitJSON.data[splitNumber].start_lon);
var latlng2 = new GLatLng(splitJSON.data[splitNumber].fin_lat,
splitJSON.data[splitNumber].fin_lon);
addSplitMarker(latlng1,latlng2);
}
</script>
As you can see there is some PHP in there to insert a JSON object,
which is different on each call.
On the first call the JSON is evaluated correctly and things work
fine. On the second call the HTML is generated correctly ( checked via
FireBug ), but the "new" function does not seem to replace that
defined from the first call.
Where am I going wrong...
thanks
RK
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---