首页 > 解决方案 > 尝试自动扫描其他域上的闪存嵌入链接

问题描述

我试过这段代码来拉网站,但是当我测试它时,警报框没有运行。

<script type="text/javascript" >
$(document).ready(function(){
$.get( "https://crossorigin.me/https://google.com", function( data ) {
alert( "Data Loaded: " + data );
});
});
</script>

标签: javascriptjqueryhtmlajax

解决方案


文档中获取,尝试实现该.fail方法以查看问题所在。

var jqxhr = $.get( "example.php", function() {
  alert( "success" );
})
  .done(function() {
    alert( "second success" );
  })
  .fail(function() {
    alert( "error" );
  })
  .always(function() {
    alert( "finished" );
  });
 
// Perform other work here ...
 
// Set another completion function for the request above
jqxhr.always(function() {
  alert( "second finished" );
});

crossorigin.com的作者也警告说

请不要在生产现场使用代理。

我无法保证服务的稳定性,您可能会遇到服务中断的情况。


推荐阅读