开发者

how to concatenate javascript and rails 3

开发者 https://www.devze.com 2023-03-11 03:10 出处:网络
I have the following code in my application.erb.html $alertdiv.text(\"some message开发者_StackOverflow中文版\"); but I need to pass in message instead of hard coded message. I need to pass in the noti

I have the following code in my application.erb.html $alertdiv.text("some message开发者_StackOverflow中文版"); but I need to pass in message instead of hard coded message. I need to pass in the notice so I tried doing something like $alertdiv.text(<%= notice %>); but that didn't work


You still need to wrap the <%= %> tags in quotation marks:

$alertdiv.text("<%= notice %>");
0

精彩评论

暂无评论...
验证码 换一张
取 消