jQuery unterminated string literal -
i getting unterminated string literal error, understand php code in script cannot understand what..
here have:
jquery('#update-<?php echo $row->id; ?>').live('click', function (){ var myname = "<?php $_post['name_two'] ?>"; var mystep = "<?php $_post['step_two'] ?>"; jquery.ajax({ type: "post", url: "postdata.php", data: {name_two:myname, step_two:mystep}, success: function(data) { alert(data); }, }); });
the error on line:
var myname = "<?php $_post['name_two'] ?>";
thanks rick
try use echo
here removing double quotes if unnecessary here:
var myname = <?php echo $_post['name_two'] ?>; var mystep = <?php echo $_post['step_two'] ?>;
Comments
Post a Comment