简体   繁体   中英

escape_javascript not working in rails 3.2.7

In application.js:

$(document).ready(function() {
    var After = 5000;
    var refreshId = setInterval(function() {
        $("#test").html("<%= escape_javascript(render_cell :test, :display) %>");
    }, After);
});

This is supposed to render the cell...But what it gives me in the browser is this: <%= escape_javascript(render_cell :test, :display) %>

Rails did not interpret the ruby part...It just gives it back as plain text...

What could be wrong?

did you mean application.js.erb?

JavaScript doesn't know ruby.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM