Refreshing a div using javascript in PHP -
so creating approve or deny page several users in php , page building needs refresh
1.what trying refreshing specific div
function refresh in javascript working there sudden duplication of div.
i checked several times , there no double(2) input="type" search.
what line should modify in remove duplicate search in div ref1 ?
- can guys please suggest alternative way refresh div ?
<style> #ref2{ background-color: darkseagreen; } #ref1{ background-color: pink; } </style> <body> <div id="ref1"> shortcut preview ** php -> isset ....add, delete, approve, search view content (select * dbname) see image ^ </div> <div id="ref2"> <form action="tor.php" method="post"> <input type="text" name="search" placeholder="search members.." onkeydown="searchq();" required /> <input type="submit" value=">>"> <?php echo("$output"); ?> </form> </div> <script langauge="javascript"> function updatecontent() { $.get("#", function(data) { $("#ref1").html( data ); }); } setinterval(updatecontent, 1000); </script> </body> </html>
you need content of ref1 div replace previous content with, entire html page , replace div content it.
function updatecontent() { $.get("#", function(data) { var x = document.createelement("div"); x.innerhtml = data; $("#ref1").html( $(x).find("#ref1").html()); }); } setinterval(updatecontent, 1000);
Comments
Post a Comment