Jump to content

Echo jquery in php


phpmonster

Recommended Posts

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

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

 

script does get executed as it echoes test

 

echo ' test';

echo '<script type="text/javascript">';

echo '$("#quantity").append(function(index, html) { ';

echo 'return';

echo '<form name="f1" id="f1"><input name="f1" id="f_1" type="hidden" value="1235" /></form>';

echo ' });';

echo '</script>';

Link to comment
https://forums.phpfreaks.com/topic/234305-echo-jquery-in-php/
Share on other sites

Yeah, this is what I get in the source:

 

test<script type="text/javascript">$("#quantity").append(function(index, html) { return<form name="f1" id="f1"><input name="f1" id="f_1" type="hidden" value="1235" /></form>   });</script>

Link to comment
https://forums.phpfreaks.com/topic/234305-echo-jquery-in-php/#findComment-1204303
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.