RubyonRails javascript被截断
我在视图中看到了这个javascript片段RubyonRails javascript被截断,javascript,ruby-on-rails,Javascript,Ruby On Rails,我在视图中看到了这个javascript片段 <script type="text/javascript"> function save_RefMD(apt_id,refmd_id) { //get the value of the text box cb = document.getElementById("selectall"); if(cb == null){ document.location.
<script type="text/javascript">
function save_RefMD(apt_id,refmd_id) {
//get the value of the text box
cb = document.getElementById("selectall");
if(cb == null){
document.location.href ='/apts/save_refmd?id='+apt_id+'&refmd_id='+refmd_id;
} else {
document.location.href ='/apts/save_refmd?id='+apt_id+'&refmd_id='+refmd_id+'&all='+cb.checked;
}
}
</script>
函数save\u RefMD(apt\u id,RefMD\u id){
//获取文本框的值
cb=document.getElementById(“selectall”);
如果(cb==null){
document.location.href='/apts/save_refmd?id='+apt_id+'&refmd_id='+refmd_id;
}否则{
document.location.href='/apts/save_refmd?id='+apt_id+'&refmd_id='+refmd_id+'&all='+cb.checked;
}
}
当我运行本地rails服务器并查看该视图的页面源代码时。完全一样。但是,当我在源代码部署到Web服务器后查看它时,它看起来是这样的
<script type="text/javascript">
function save_RefMD(apt_id,refmd_id) {
//get the value of the text box
cb = document.getElementById("selectall");
document.location.href ='/apts/save_refmd?id='+apt_id+'&refmd_id='+refmd_id+'&all='+cb.checked;
}
</script>
函数save\u RefMD(apt\u id,RefMD\u id){
//获取文本框的值
cb=document.getElementById(“selectall”);
document.location.href='/apts/save_refmd?id='+apt_id+'&refmd_id='+refmd_id+'&all='+cb.checked;
}
完全去掉我的if…else。有人知道发生了什么吗?是的,只是部署了旧代码。其他人负责部署,我被告知我的人在那里完成了部署。假设,假设。很抱歉打扰您。您确定这是“剥离”而不仅仅是使用过时的版本吗?:(我想我直接跑是因为一个更复杂的原因……所以这就是答案?它只是一个过时的版本?