如何在IE8和jquery中使用.html()?没有闪烁的HTML页面?

时间:2014-06-03 08:01:24

标签: jquery html ruby-on-rails internet-explorer-8

jquery + html + Rails 4

$('#onward').html("<%= escape_javascript(render 'bus_listing', :is_return => true) %>"); // not working in < IE8. Other browser working fine

bus_listing是部分。

$('#onward')[0].innerHTML = "<%= escape_javascript(render 'bus_listing', :is_return => false) %>"; // working in but full Html page is flickering and not adding the new data in html.

IE8中替换.html()的任何解决方案。请分享。

1 个答案:

答案 0 :(得分:1)

您是否尝试过innerHTML?

document.getElementById('onward').innerHTML="<%= escape_javascript(render 'bus_listing', :is_return => true) %>"