<script src="/js/default.js"></script>
</head>
<body>
<div id="xhrDiv"></div>
<script type="text/javascript">
//to fetch text type
WinJS.xhr({ url: "http://www.sportskeeda.com/2013/01/15/fluminense-in-talks-with- riquelme/", responseType: "text" })
.done(
function (request) {
var text = request.responseText;
var subText = text.substring(text.indexOf("Brazilian"), text.indexOf("Xinhua.") + 9);
xhrDiv.innerHTML = subText;
});
// to fetch blob type
WinJS.xhr({ url: "http://www.microsoft.com/windows/Framework/images/win_logo.png", responseType: "blob" })
.done(
function (request) {
var imageBlob = URL.createObjectURL(request.response);
var imageTag = xhrDiv.appendChild(document.createElement("image"));
imageTag.src = imageBlob;
});
</script>
问问题
178 次