# Render :update issue

**URL:** <https://www.ruby-forum.com/t/render-update-issue/103999>\
**Category:** Rails\
**Created:** [May 12, 2007, 6:11pm UTC](https://www.ruby-forum.com/t/render-update-issue/103999 "2007-05-12T18:11:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubynate](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ebca7d/32.png) [@rubynate](https://www.ruby-forum.com/u/rubynate)\
**Post date:** [May 12, 2007, 6:11pm UTC](https://www.ruby-forum.com/t/render-update-issue/103999/1 "2007-05-12T18:11:01Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![rubynate](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ebca7d/32.png) [@rubynate](https://www.ruby-forum.com/u/rubynate)\
**Post date:** [May 12, 2007, 7:25pm UTC](https://www.ruby-forum.com/t/render-update-issue/103999/2 "2007-05-12T19:25:14Z")

</div>

Nevermind, it looks like a bug with the js package I’m using…
