gadgets.io.makeRequest返回特定网站上的空html文档

时间:2011-09-02 06:59:51

标签: javascript html google-gadget

我正在尝试使用gadgets.io.makeRequest来检索网站http://www.novasoftware.se/webviewer/(S(r2vc0j45wbu53x55slbdce55))/MZDesign1.aspx?schoolid=27500&code=82820 它以前工作过,但现在它返回空的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>

这是我正在使用的简单代码:

<?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>

该网站是否有可能阻止它?我怎么看?此相同的代码适用于其他网址,例如http://www.google.com 我也没有在返回字符串中得到任何错误

0 个答案:

没有答案