[英]How to load the external url in div without iframe
我想在不使用iframe / embed / object标记的情况下在div中加载外部网址。 我已经使用了示例,但是没有用
例如:
$("#testDiv").load("//localhost:8000/cities/Mountain%20View/521/bottle-service/new");
要么
$("#testDiv").load("//www.xyz.com");
谁能帮我解决这个问题?
根据您的评论,我认为您需要以下内容:
$('#mydiv').load('http://localhost:8000/cities/Mountain%20View/521/bottle-service/new #testDiv', function(response, status, xhr) {
if (status == "error") {
var msg = "Sorry but there was an error: ";
alert(msg + xhr.status + " " + xhr.statusText);
}
});
为了获得更好的见解,我将这个问题与此帖子相关联
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.