开发者

Echo jquery in php

how come this doesnt echo out on my page? supposed to be an ajax call:

Trying to write a form tag to the #quantity div.

echo '<script type="text/javascript">' . "\n";
echo '$("#quantity").append(function(index, html) { '. "\n";
echo 'return' . "\n";
echo '<form name="f1" id="f1"><input name="f1" id="f_1" type="hidden" value="1235" /></for开发者_运维问答m>' . "\n";
echo '  });' . "\n";
echo '</script>' . "\n";


<script>
var elem = '<form name="f1" id="f1"><input name="f1" id="f_1" type="hidden" value="'<?php echo $items["rowid"]; ?>'" /></form>';
$('#quantity').append(elem);
</script>

You were missing the single quotes around your PHP.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜