xmlhttprequest

Since v38, Chrome extension cannot load from HTTP URLs anymore, workaround?

时光毁灭记忆、已成空白 提交于 2020-01-06 14:37:09
问题 The users of our website run our Chrome plugin which, amongst other things, performs cross-origin requests via XMLHttpRequest as described on the Chrome extension development pages. This has been running just fine for a few years now. However, ever since our users upgraded to the latest version of Chrome (v38), these requests have failed. Our site runs on HTTPS and some of the URLs loaded via our content script are on HTTP. The message is: [blocked] The page at 'https://www.ourpage.com/' was

Get request header from freemarker

不打扰是莪最后的温柔 提交于 2020-01-06 11:02:12
问题 I want to create AJAX-navigation on my site with Freemarker as template engine. If page are requested with XMLHttpRequest , there is no need to include page header and footer. Code will be look like this: [#if !XMLHttpRequest] [#include "header.ftl"] [/#if] ${content} [#if !XMLHttpRequest] [#include "footer.ftl"] [/#if] My question is how to define that the request came with AJAX. Client adds header X-Requested-With: XMLHttpRequest, and how do I get it in Freemarker? I tried to find it in

angularJS $http.Post not working: Failed to load resource: Request header field 0 is not allowed by Access-Control-Allow-Headers

狂风中的少年 提交于 2020-01-06 10:53:45
问题 I'm using $http to post some data to my data base. Here is the documentation of the database. I use it on my terminal and it works. Here's the error message I got from Safari's console: 1)Failed to load resource: Request header field 0 is not allowed by Access-Control-Allow-Headers. (seems to be sensed by the database) 2)XMLHttpRequest cannot load https://beta-api.mongohq.com/mongo/MyDId/myDatabse/collections/myCollection/documents. Request header field 0 is not allowed by Access-Control

XHR sync calls failing in Chrome. Script not waiting for the xhr response

拥有回忆 提交于 2020-01-06 08:16:28
问题 Issue: While working in Chrome, script not waiting for the Synchronous xhr response. Working fine in FireFox/IE. Have used onreadyStateHandlers as well, but still, before the response is received the other codes are executed. function callingScript() { var a=callServer(); alert(a);//Here a is showing undefined while executing in chrome. But in FF/IE its waiting for the response and then alerts a with response. } function callServer() { var response; var httpRequest = new XMLHttpRequest();

extjs4 store addes get params in the url

半世苍凉 提交于 2020-01-06 07:52:53
问题 i'm using extjs4 store In xhtpp calls it shows the http://localhost/home_dir/index.php/questions/content_pie?_dc=1312366604831&hi=&page=1&start=0&limit=25 This is the store code var content_type_store = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ url: BASE_URL+'questions/content_pie', method:'POST', params :{hi:''} }), reader: new Ext.data.JsonReader({ root: 'results' }, [ 'qtype', 'qval' ]) }); Even though i set the method as POST its get params appears in url I'm using codeigniter

extjs4 store addes get params in the url

坚强是说给别人听的谎言 提交于 2020-01-06 07:52:27
问题 i'm using extjs4 store In xhtpp calls it shows the http://localhost/home_dir/index.php/questions/content_pie?_dc=1312366604831&hi=&page=1&start=0&limit=25 This is the store code var content_type_store = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ url: BASE_URL+'questions/content_pie', method:'POST', params :{hi:''} }), reader: new Ext.data.JsonReader({ root: 'results' }, [ 'qtype', 'qval' ]) }); Even though i set the method as POST its get params appears in url I'm using codeigniter

VBA - web scraping can not find correct GET request

本秂侑毒 提交于 2020-01-06 05:23:27
问题 My question is related to other question VBA - web scraping can not get HTMLElement innerText. I have a similar problem Website URL - https://www.hnb.hr/en/core-functions/monetary-policy/exchange-rate-list/exchange-rate-list I need to get the date of currency reference and the selected values. The problem is that I can not find a correct GET request where these values are finally generated. I've found that it is related to the POST request: POST /en/core-functions/monetary-policy/exchange

XMLHttpRequest automatically replaces backslash (\) with slash (/)

倾然丶 夕夏残阳落幕 提交于 2020-01-05 09:11:53
问题 I am trying to run a small javascript script. one of the parameters of the XMLHttpRequest is a file path, so a URL would look like: http://myaddress:myport/action/C:\\PATH\\TO\\MY\\FILE.EXT/some/other/params however, XMLHttpRequest changes the address to: http://myaddress:myport/action/C://PATH//TO//MY//FILE.EXT/some/other/params which breaks the application. How can I prevent XMLHttpRequest from changing the requested address? 回答1: Don't put raw special characters in the URL.

webRequest API: How to get the requestId of a new request?

狂风中的少年 提交于 2020-01-05 08:48:51
问题 The chrome.webRequest API has the concept of a request ID (source: Chrome webRequest documention): Request IDs Each request is identified by a request ID. This ID is unique within a browser session and the context of an extension. It remains constant during the the life cycle of a request and can be used to match events for the same request. Note that several HTTP requests are mapped to one web request in case of HTTP redirection or HTTP authentication. You can use it to correlate the

How to catch the error thrown by an invalid URL using XMLHttpRequest

爱⌒轻易说出口 提交于 2020-01-05 07:06:55
问题 I have not worked much with the XMLHttpRequest object in JavaScript . I am new to it. I have done many jQuery Ajax calls, but have not worked in much detail with the XMLHttpRequest object. I am working through a book where they give some sample code using this object. Here is some code the book uses when trying to deal with errors. It is supposed to catch the error thrown by the incorrect URL. But I can't get it to go it the catch clause : var httpRequest = new XMLHttpRequest(); try {