javascript - Moving a value after php returns the table -
i have title on page. inside div tag. when page displayed simple , says "net control manager". after user makes selection php program runs mysql , returns table. returns value want put title. "net control manager: pcarg" example.
the problem i'm not sure how put piece div. write value div echo php "echo $value" returned correctly. in onload in body tag use function retrieve new div (newport), , add title div. since onload happens first "undefined".
how make wait new div written new data? or there method don't know about.
if read correctly, you're looking pick text , append div's text?
you -- making sure it's @ bottom of html before closing </body>
tag.
<script type="text/javascript"> $(document).ready(function () { var title = $('#title'); // or whatever div id or class name is. var newport = $('#newport'); // or whatever div id or class name is. // append text `newport` onto `title` div. title.text(title.text() + ' ' + newport.text()) }); </script>
Comments
Post a Comment