PHP How to edit HTML element Content? -


just $('#elementid').html('html code'); in php. there way change live content php without reloading page? tried

<?php echo '<script type="text/javascript">     $('#element').html('<p>i text</p>');       </script>' ?> <div id='element'>i changed!</div> 

is there shorter way, 1 not works everytime.

$.post('test.php','',function(response){    $('#element').html(res);  }); 

test.php

$name = "sham"; echo "this variable $name"; 

output of html

<div id='element'>this variable sham</div> 

Comments

Popular posts from this blog

jQuery Mobile app not scrolling in Firefox -

c++ - How to add Crypto++ library to Qt project -

php array slice every 2th rule -