xmlhttprequest

Google Chrome: A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true

落花浮王杯 提交于 2019-12-22 13:48:42
问题 I know this is something usual, With the earlier versions of chrome I used to set "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --args --disable-web-security --user-data-dir in chrome shortcut tab to avoid 'Access-Control-Allow-Origin' errors. With the latest version, it seems like this fix is not working anymore. After installing the latest version 53.0.2785.89 m this is the error in console XMLHttpRequest cannot load https://example.org:15003/apps/services/preview/rr/common

Javascript AJAX function not working in IE?

爷,独闯天下 提交于 2019-12-22 12:36:08
问题 I have this code: function render_message(id) { var xmlHttp; xmlHttp=new XMLHttpRequest(); xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { document.getElementById('message').innerHTML=xmlHttp.responseText; document.getElementById('message').style.display=''; } } var url="include/javascript/message.php"; url=url+"?q="+id; xmlHttp.open("GET",url,true); xmlHttp.send(null); } For some reason it does not work in IE and an error is being reported on this line "document

Can chrome WebRequest API monitor the http request?

♀尐吖头ヾ 提交于 2019-12-22 12:20:41
问题 I want to monitor all the http request send from my chrome browser, and collect all the http request to another server. I have read This question and These examples, but I don't know how to get the content of the request. For example, when I browse google.com in my chrome browser with this chrome extension, this extension will send the following the another server which will collect it: GET http://www.google.com/ HTTP/1.1 Accept: text/html, application/xhtml+xml, */* Accept-Language: zh-CN

XMLHttpRequest.send failing with relative path

僤鯓⒐⒋嵵緔 提交于 2019-12-22 11:13:18
问题 I'm having difficulty with something probably remedial. I'm developing a website without a server. In doing so, I run into problems when trying to access files via XMLHttpRequest. As you can see in the example code snippet, I create the variable, open it with a relative path to the desired file, and use the send function. When I use a relative path that has to traverse up to a parent directory, the send() function fails. However, if I provide a path that is either in the same directory as the

XMLhttpRequest > PHP > XMLhttpRequest

自作多情 提交于 2019-12-22 09:01:26
问题 I have another question. XMLhttpRequests haunt me. Everything is now in the database but I need this data to update my page on firt page load or reload. The XHR is triggered in JavaScript file which triggers PHP-Script. PHP-Script access MySQL database. But how do I get the fetched records back into my JavaScript for page update. I can not figure it out. First my synchronous XMLhttpRequest: function retrieveRowsDB() { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera,

XMLHttpRequest passing a variable to php script

回眸只為那壹抹淺笑 提交于 2019-12-22 09:00:11
问题 I am trying to pass a variable to a php script using XMLHttpRequest and then have the php echo it back. I can't understand why it isn't working, could someone please help me. Here is the Javascript. <script language="javascript" type="text/javascript"> // Browser Support function Heatctrl(heatMode){ var heatControlRequest; try{ //Good Browsers heatControlRequest = new XMLHttpRequest(); } catch (e) { //Internet Explorer try{ heatControlRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e)

Verifying XMLHttpRequest in php

╄→尐↘猪︶ㄣ 提交于 2019-12-22 08:57:48
问题 I am sending data to a PHP site using the following code: if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp= new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp= new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET","addEmail.php?email="+escape(email),true); xmlhttp.send(); xmlhttp.close; Is there any way of making sure that the addEmail.php is being run through the XMLHttpRequest so people cant simply go to www.domain.com/addEmail.php?email

How can I do a synchronous request with jQuery?

谁说我不能喝 提交于 2019-12-22 08:33:38
问题 Why don't return that function the responseText? function LoadBookmarksAsXml() { return $.ajax( { type: 'GET', async: false, url: 'http://www.google.com/bookmarks/?output=xml&num=10000' }).responseText; } (It works if I define a success-callback-function and set async to true!) Thanks in advance!! Edit : Don't worry about the cross-domain call; user603003 says (in a comment on a now-deleted answer) that this is in a Chrome extension where cross-domain requests are allowed. The solution if

jQuery AJAX JSONP error “Unexpected token”

半城伤御伤魂 提交于 2019-12-22 08:31:51
问题 I'm trying to make a cross domain JSONP call in Chrome, but the I keep getting back "Uncaught SyntaxError: Unexpected token :" I've tried: changing the response content type, setting xhr headers, JSON.stringify, just about most of the solutions offered on here but nothing worked so far :-( $.ajax({ type: "POST", url: "https://www.virustotal.com/vtapi/v2/url/report", crossDomain: true, contentType: "application/json; charset=UTF-8", dataType: 'jsonp', data: { apikey: "*", resource: "http://www

Is there a way to determine a line from which XHR was issued in firebug or web inspector?

醉酒当歌 提交于 2019-12-22 07:03:59
问题 Is there a way to determine a line and filename from which XHR was issued in Firebug or Web Inspector (maybe Opera Dragonfly/IE Developers Toolbar)? If there isn't, what is the best way to find that out? Just searching the codebase for the URI called? (often it will be constructed, though) 回答1: In Developer Tools(chrome) you can set breakpoints for any XHR from the Script tab. Script Tab XHR Breakpoints(on right hand side) Click the + and press return A new item will be added saying "Any XHR"