Hey all,
I have a case where I need to use rjs to update add some new content
(a prototype window) to a page and then fill in the content of that
window. The issue I’m running into is that to create the window I call
a javascript function which creates the window. The, I need to fill in
a div in that window with some content which is produced from another
javascript call.
If I make the calls back to back in my render :update block, I get an
error that an invlaid or illegal string was specified. I’m assuming
that this is because the div I created with my first javascript call
isn’t present in the page that is being used to call the second.
The code looks something like this:
render :update do |page|
page.call “createWindow”, *params…
page.call “fillInWindow”
end
The fillInWindow function is attempting to load content into a div
created by the createWindow call. Is there some way to update the page
before calling the second js function?
I hope this makes sense, any help would be greatly appreciated!