Javascript 什么';这个JQuery有什么问题?

Javascript 什么';这个JQuery有什么问题?,javascript,jquery,Javascript,Jquery,当我这样做的时候 $(document).ready(function(){ $('form').live('submit', function(){ $('#template').tmpl([{ "id" : "555" }, { "in" : "checked" } ]).prependTo('#content'); }); }); 带和带HTML <!DOCTYPE html> <html dir="ltr"> <head&g

当我这样做的时候

$(document).ready(function(){
   $('form').live('submit', function(){
      $('#template').tmpl([{ "id" : "555" }, { "in" : "checked" }   ]).prependTo('#content');
   });
});
带和带HTML

<!DOCTYPE html>
<html dir="ltr">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <script src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
    <script src="http://jqueryui.com/ui/jquery.ui.core.js"></script>
        <script src="http://jqueryui.com/ui/jquery.ui.widget.js"></script>
    <script src="http://jqueryui.com/ui/jquery.ui.datepicker.js"></script>
    <script src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script>

    <script type="text-x-jquery/template" id="template"> 
      <form action="" method="post">
      "${id}" <div class="cellData cellRadios"> <input name="ctype" value="individuel" type="radio" "${in}"/> </div>
      </form>
    </script>

  </head>
  <body>

  <form action="" method="post">
  <input value="Save" type="submit">
  </form>

  <br><br>

  <div id="content"> </div>
这是错误的吗


更新用失败的代码更新了JSFIDLE和post。

我在HTML中更改了以下内容:

<script type="text/x-jquery-tmpl" id="template">
    <form action="" method="post">
        "${Id}" <div class="cellData cellRadios"> <input name="ctype" value="individuel" type="radio" ${In} /> </div>
    </form>
</script>
现在它对我有效了


我认为问题在于模板变量名,我将它们大写,模板数据是由2个对象组成的数组,而不是一个简单的对象。(还对模板脚本MIME做了一点修改。)

@Sandra:你的小提琴很好,我看到“555”出现在表单发布之前……你说得对。这是怎么回事!我一定把问题简化得太多了。我没有错。它在保存按钮下写555,但没有错误。您是否检查过浏览器是否正确下载了tmpl文件?(注意,这是两个小提琴。)发布一个有效的小提琴似乎很愚蠢。现在我已经找到并添加了损坏的代码。问题特别在于,它是javascript中的保留字:
<script type="text/x-jquery-tmpl" id="template">
    <form action="" method="post">
        "${Id}" <div class="cellData cellRadios"> <input name="ctype" value="individuel" type="radio" ${In} /> </div>
    </form>
</script>
$(document).ready(function(){
   $('form').live('submit', function(){
      $('#template').tmpl({ "Id" : "555","In" : "checked" }).prependTo('#content');
       return false;
   });
});