Quand jeQuel est le problème avec ce JQuery?
$(document).ready(function(){
$('form').live('submit', function(){
$('#template').tmpl([{ "id" : "555" }, { "in" : "checked" } ]).prependTo('#content');
});
});
avec et avec le langage 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>
puis la console d'erreur dans Firefox dit Erreur de syntaxe dans la ligne 1 de jquery.tmpl.min.js
qui est de JQuery.tmpl()
jsFiddle à
Est-il
$('#template').tmpl([{ "id" : "555" }, { "in" : "checked" } ]).prependTo('#content');
qui ne va pas?
Mise à jour Mise à jour de JSFiddle et de la publication du code qui échoue.
@Sandra: Votre violon fonctionne très bien, je vois "555" apparaître avant que le formulaire est affiché ... –
Cela fonctionne pour moi – wong2
Vous avez raison. Qu'est-ce qui se passe ici! J'ai dû trop simplifier le problème. http://jsfiddle.net/Cu5Mj/3/ –