I would like to add a Javascript at the end of some ajax content, It works fine on firefox but internet explorer print the script without running it.
<script type="text/javascript">
$.tablesorter.addParser({
id: 'title',
is: function(s)
{
return false;
},
format: function(s)
{
s= s.substring(s.indexOf('<span class="title">')+24,s.length-30);
return s.replace(' ','');
},
type: 'text'
});
$.tablesorter.addParser({
id: 'price',
is: function(s)
{
return false;
},
format: function(s)
{
s= s.substring(0,s.length-3);
return s.replace(' ','');
},
type: 'digit'
});
$(document).ready(function()
{
$("#result").tablesorter({
headers: {
0: {sorter:'title'},
1: {sorter:'price'},
2: {sorter: false}
}
});
});
</script>
function submitForm()
{
$("form#search").ajaxSubmit({
beforeSubmit: function(formData, jqForm, options) {
$("#window").html('<div style="text-align:center; display:block;"><img src="../images/commun/spinner.gif" /></div>');
return true;
},
success: function(msg, statut) {
$("#window").html(msg);
return false;
}
});
}