xmlhttprequest

VBA HTML Scraping - '.innertext' from complex table

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-29 01:59:09
问题 All, I've created the following Module to scrape a single value (1m % change in London house prices) from the below address: https://www.hometrack.com/uk/insight/uk-cities-house-price-index/ The specific value is nested within the following code: The below VBA code is my attempt at scraping. I, perhaps wrongly, feel that I am very close to capturing the value - but the code will not work. Does anyone know where I am going wrong here? It doesn't show an error message but also doesn't output

Cross-domain JSON request?

。_饼干妹妹 提交于 2019-12-28 13:45:10
问题 Question: I'm trying to use JSON accross domains, but all i find is JSON parsers, which I don't need... I've read that it's possible to do cross-domain requests with JSON, but so far, all I see is implementations that use XMLHttpRequest... - which means you can't use cross-domain requests, at least not outside IE 8... I've been on http://www.json.org/, but all I find is either parsers or useless. The best I've found with google so far is http://devpro.it/JSON/files/JSONRequest-js.html but

Why cookies and set-cookie headers can't be set while making xmlhttprequest using setRequestHeader?

孤街浪徒 提交于 2019-12-28 08:17:40
问题 I was wondering why one cannot set cookie headers using setRequestHeader. Is there any specific reason or just that they are added by browser itself, so these headers are disabled? Is there any security issue? --Edit I am working on node.js and used the xmlhttprequest module. Following is the test code: var xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.withCredentials = true; xhr.setRequestHeader('Cookie', "key=value"); xhr.send(null); Here I need to set cookie-header as node.js

Downloading binary data using XMLHttpRequest, without overrideMimeType

别来无恙 提交于 2019-12-28 06:35:41
问题 I am trying to retrieve the data of an image in Javascript using XMLHttpRequest . var xhr = new XMLHttpRequest(); xhr.open("GET", "http://www.celticfc.net/images/doc/celticcrest.png"); xhr.onreadystatechange = function() { if (xhr.readyState === 4) { var resp = xhr.responseText; console.log(resp.charCodeAt(0) & 0xff); } }; xhr.send(); The first byte of this data should be 0x89 , however any high-value bytes return as 0xfffd ( 0xfffd & 0xff being 0xfd ). Questions such as this one offer

How can I modify the XMLHttpRequest responsetext received by another function?

▼魔方 西西 提交于 2019-12-28 03:38:13
问题 I am trying to modify the responseText received by a function that I cannot modify. This function creates a XMLHttpRequest that I can attach to, but I have been unable to "wrap" the responseText in a way that allows me to modify the content before the original function receives it. Here's the full original function: function Mj(a, b, c, d, e) { function k() { 4 == (m && 'readyState' in m ? m.readyState : 0) && b && ff(b) (m) } var m = new XMLHttpRequest; 'onloadend' in m ? m.addEventListener(

AJAX详解

。_饼干妹妹 提交于 2019-12-28 00:55:29
AJAX 1. 概述 Web 程序最初的目的就是将信息(数据)放到公共的服务器,让所有网络用户都可以通过浏览器访问。 在此之前,我们可以通过以下几种方式让浏览器发出对服务端的请求,获得服务端的数据: A 地址栏输入地址,回车,刷新 B 特定元素的 href 或 src 属性 C 表单提交 这些方案都是我们无法通过或者很难通过代码的方式进行编程(对服务端发出请求并且接受服务端返回的响应), 如果我们可以通过 JavaScript 直接发送网络请求,那么 Web 的可能就会更多,随之能够实现的功能也会更多,至 少不再是 “ 单机游戏 ” 。 AJAX ( Asynchronous JavaScript and XML ),最早出现在 2005 年的 Google Suggest ,是在浏览器端进行网络编程(发送请求、接收响应)的技术方案,它使我们可以通过 JavaScript 直接获取服务端最新的内容而不必重新加载页面。让 Web 更能接近桌面应用的用户体验。 说白了, AJAX 就是浏览器提供的一套 API ,可以通过 JavaScript 调用,从而实现通过代码控制请求与响应。实现网络编程。 2 . 快速上手 readyState 状态描述 说明 0 UNSENT 代理( XHR )被创建,但尚未调用 open() 方法。 1 OPENED open() 方法已经被调用,建立了连接

How do you send a custom header in a cross-domain (CORS) XMLHttpRequest?

瘦欲@ 提交于 2019-12-27 22:40:12
问题 I am trying to send a CORS request for a JSON payload. I control both the server and the client. I'm following along here: https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS?redirectlocale=en-US&redirectslug=HTTP_access_control The server has a custom header that must be sent along with every request. This custom header therefore makes the request 'not simple' and thus the request must be preflighted with an OPTIONS request. I can see jquery making the OPTIONS request, but it

SCRIPT5: Access is denied in IE9 on xmlhttprequest

拜拜、爱过 提交于 2019-12-27 17:30:51
问题 var xhttp=new XMLHttpRequest(); xhttp.open('GET', 'foo.xml', false); F12 pops back: SCRIPT5: Access is denied. on Line 95, which is the xhttp.open line. My JavaScript seems well-formed, and Firefox does what I think it should. I've read a lot of questions very similar to this one, so I've checked out the Same Origin Policy, but I can't see how it'd apply considering foo.xml is in the same directory as the html file. I opened up the scripting permissions on my local intranet, and told McAfee

SCRIPT5: Access is denied in IE9 on xmlhttprequest

南笙酒味 提交于 2019-12-27 17:30:41
问题 var xhttp=new XMLHttpRequest(); xhttp.open('GET', 'foo.xml', false); F12 pops back: SCRIPT5: Access is denied. on Line 95, which is the xhttp.open line. My JavaScript seems well-formed, and Firefox does what I think it should. I've read a lot of questions very similar to this one, so I've checked out the Same Origin Policy, but I can't see how it'd apply considering foo.xml is in the same directory as the html file. I opened up the scripting permissions on my local intranet, and told McAfee

Empty responseText from XMLHttpRequest

笑着哭i 提交于 2019-12-27 11:47:15
问题 I have written an XMLHttpRequest which runs fine but returns an empty responseText. The javascript is as follows: var anUrl = "http://api.xxx.com/rates/csv/rates.txt"; var myRequest = new XMLHttpRequest(); callAjax(anUrl); function callAjax(url) { myRequest.open("GET", url, true); myRequest.onreadystatechange = responseAjax; myRequest.setRequestHeader("Cache-Control", "no-cache"); myRequest.send(null); } function responseAjax() { if(myRequest.readyState == 4) { if(myRequest.status == 200) {