javascript - How to refresh <iframe> using Ajax? -
i refresh link http://radiojoven.6te.net/capas.php
using ajax. i've been trying, no avail. here's have far:
<script> function checkrequest() { var interval = settimeout(function () { $.ajax({ url: "http://radiojoven.6te.net/capas.php", type: "post", datatype: "html" }) .done(function (msg) { $("capas").html(msg); }) .always(function () { checkrequest(); }); }, 20000); } </script>
the iframe plan update:
<div id="capas"><iframe src="http://radiojoven.6te.net/capas.php" width="1000px" height="300px" border="0" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe></div>
if can me in work, grateful.
already thank you.
i recommend rid of iframe
, use ajax
.
the reason why never updates capas
div not referenced correctly.
you need $("#capas").html(msg);
// note # refer id of element.
as additional note, doesn't seem posting data server, therefore may better of using http get
rather http post
.
Comments
Post a Comment