在iframe中注入或查找和替换

时间:2016-05-01 19:39:16

标签: javascript php jquery iframe cross-domain

是否有可能注入JavaScript或查找和替换iframe旁边的文本?

例如: www.xyz.com是我的网站,www.91sms.in是我无法访问的远程站点。

所以我的文件看起来像这样(www.xyz.com/localiframe.php)

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Cartin - Themes</title> 

<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script type="text/javascript"> 
$(document).ready(function(){
$("body").children().each(function() {           
  $(this).html($(this).html().replace(/2016/g,"2014-16 Powered by 91sms.in"));
});
})
</script>

</head>
<body>

 <iframe width="100%" height="600px" src="http://www.91sms.in"> </iframe>

</body>
</html>

在我的iframe中我希望脚本在iframe中搜索2016,它应该被2016-2017替换

我尝试了很多脚本,但没有一个正在运行,请给我一些建议。请注意,我无法访问91sms.in网站。

谢谢

0 个答案:

没有答案