[ .html() ] Automatic transformation tag ??
Hi all,
I have a problem with
.html() method of jQuery...
This command change the code who is insert,
for example, this is my code :
-
var url_ajax = [...];
$.ajax(
{
url: url_ajax,
success: function(rep_ajax)
{
$("#jqueryui_id").html(rep_ajax);
/* test */
alert(rep_ajax);
alert($("#jqueryui_id").html());
}
});
this code reply two alerts :
alert(rep_ajax);
-
<div>
<form action="traitement.php" method="post">
<select name="name1">
[...]
</select>
<select name="name2">
[...]
</select>
<input type="submit" />
</form>
</div>
<script>
/* jQuery script */
</script>
alert($("#jqueryui_id").html());
-
<div>
<form action="traitement.php" method="post"></form>
<select name="name1">
[...]
</select>
<select name="name2">
[...]
</select>
<input type="submit" />
</div>
We can see, the
.html() method transform the tag, here it close the <form> tag or delete <script> tag, so my code isn't functional...
How can I do ?!
Thank for help and sorry if you don't understood me, I'm french... :s !