正如标题所说,我遇到了问题!我遇到了“RJS 错误:[对象错误]”,我的应用程序中的代码是
page << "#{hidden_print("#{url_for(:controller => 'tables', :action => 'dispatch', :id => id, :pop => true, :print =>true)}")}
”
方法hidden_print是
def hidden_print(url)
"window.parent.headFrame.document.all.iframe_helper.src = '#{url}';"
end
最佳答案
document.all
集合仅受 Internet Explorer 支持,并且仅在怪异模式下支持。使用 getElementById
方法访问元素:
"window.parent.headFrame.document.getElementById('iframe_helper').src = '#{url}';"
关于javascript - 我的 Rails 应用程序中存在 JavaScript 错误!,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2995882/