开发者

Echo jquery in php

开发者 https://www.devze.com 2023-02-27 05:09 出处:网络
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.

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

精彩评论

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