开发者

gadgets.io.makeRequest returns empty html document on specific site

I am trying to use gadgets.io.makeRequest to retrieve the site http://www.novasoftware.se/webviewer/(S(r2vc0j45wbu53x55slbdce55))/MZDesign1.aspx?schoolid=27500&code=82820 It worked before, but now it returns empty html:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<!-- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -->
<HTML>
<HEAD>
 <META HTTP-EQUIV="Refresh" CONTENT="0.1">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<TITLE></TITLE>
</HEAD>
<BODY>
<P>
</BODY>
</HTML>

This is the simple code that I'm using:

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="My test gadget" height="400"/>
<Content type="html"><![CDATA[
<script type="text/javascript">

function getHtml() {    
  var params = {};  
 params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.TEXT;  
 var url = "http://www.novasoftware.se/webviewer/(S(r2vc0j45wbu53x55slbdce55))/MZDesign1.aspx?schoolid=27500&code=82820";
  gadgets.io.makeRequest(url, response, params);
};
function response(obj) {  
 //obj.text contains the text of the page that was requested  
  var html = obj.text;
  console.log(html);
  document.getElementById('content_div').innerHTML = 开发者_开发技巧html;
};
gadgets.util.registerOnLoadHandler(getHtml);
</script>
<div id="content_div"><p>Content here</p></div>
]]>  
</Content>
</Module>

Is it possible that the site has blocked it? And how do I see that? This same code works for other URLs like http://www.google.com I also don't get any errors in the return string

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜