views:

27

answers:

1

As the title said, I got a problem! i encountered the "RJS Error:[object error]",the code in my application is page << "#{hidden_print("#{url_for(:controller => 'tables', :action => 'dispatch', :id => id, :pop => true, :print =>true)}")} "

the method hidden_print is

  def hidden_print(url)
  "window.parent.headFrame.document.all.iframe_helper.src = '#{url}';"                                                 
  end
+2  A: 

The document.all collection is only supported by Internet Explorer, and only in quirks mode. Use the getElementById method to access the element:

"window.parent.headFrame.document.getElementById('iframe_helper').src = '#{url}';"
Guffa
I do as you say! but got no change, I describe my question clearly again. In the first page , i used the method newWindow(title,href,width,heigt) got the second pop page. now in the pop page ,i want got the headFrame's iframe_helper which in the first page's frameset! so what should i modify the code?
Small Wolf
I used "window.opener.parent.headFrame.document.getElementById('iframe_helper').src = '#{url}';" to solve the problem ,but it is still nothing works!
Small Wolf
Now I got the answer! Thank you!
Small Wolf