xmlhttprequest

Display *browser* loading indicator (like when a postback occurs) on ajax calls

点点圈 提交于 2019-12-19 05:55:33
问题 example: Go to your Facebook wall, scroll the end of the page, Facebook will load more wall posts asynchronously . Or just click on an images in your wall post. The image dialog (with comments and larger image) is loading asynchronously as well. (You can see the GET requests with firebug). But by looking and the firefox tab, you see the loading indicator, just like when a postback occurs. I know this can be achieved by using an IFrame and changing its src. Just like what iGoogle does. But I'm

Display *browser* loading indicator (like when a postback occurs) on ajax calls

北城余情 提交于 2019-12-19 05:55:07
问题 example: Go to your Facebook wall, scroll the end of the page, Facebook will load more wall posts asynchronously . Or just click on an images in your wall post. The image dialog (with comments and larger image) is loading asynchronously as well. (You can see the GET requests with firebug). But by looking and the firefox tab, you see the loading indicator, just like when a postback occurs. I know this can be achieved by using an IFrame and changing its src. Just like what iGoogle does. But I'm

Angular 6: HttpErrorResponse SyntaxError: Unexpected token s in JSON

本小妞迷上赌 提交于 2019-12-19 05:48:06
问题 I am posting a request and I am suppose to receive a 'success' string back as response. I am getting an HttpResponseError with the following information posted in the image below. PurchaseOrderService postPurchaseOrderCustom(purchaseOrderCustom: PurchaseOrderSaveCustom) { const url = `${this.localUrl}purchaseOrderCustom`; return this.http.post<String>(url, purchaseOrderCustom, {headers: this.header}) .pipe( catchError(this.handleError('postPurchaseOrderCustom', 'I am an error')) ); }

Angular 6: HttpErrorResponse SyntaxError: Unexpected token s in JSON

北城以北 提交于 2019-12-19 05:48:03
问题 I am posting a request and I am suppose to receive a 'success' string back as response. I am getting an HttpResponseError with the following information posted in the image below. PurchaseOrderService postPurchaseOrderCustom(purchaseOrderCustom: PurchaseOrderSaveCustom) { const url = `${this.localUrl}purchaseOrderCustom`; return this.http.post<String>(url, purchaseOrderCustom, {headers: this.header}) .pipe( catchError(this.handleError('postPurchaseOrderCustom', 'I am an error')) ); }

Does jQuery $.ajax or $.load allow for responseType arrayBuffer?

陌路散爱 提交于 2019-12-19 05:04:52
问题 I'm getting started with the Web Audio API and just wondering if it's possible to use jQuery's $.ajax or $.load functions to make the XMLHttpRequest that receives the audio data. Do $.ajax or $.load support responseType=arrayBuffer? EDIT: Ok, so here's what I have so far: function loadAudio() { $.ajax({ url: sourceUrl }).done(function(response){ return response; }) } but I need to return an ArrayBuffer. So how do I convert the response into an ArrayBuffer? 回答1: About your question, it seems

How to make http authentication in REST API call from javascript

◇◆丶佛笑我妖孽 提交于 2019-12-19 04:41:23
问题 I need to call OpenMRS REST API from Java script to get data from OpenMRS. Below is my java script code: function myfunction(){ var xhr = new XMLHttpRequest(); xhr.open("GET", "http://localhost:8081/openmrs-standalone/ws/rest/v1/person?q=John", false); xhr.setRequestHeader("Authorization: Basic YWRtaW46QWRtaW4xMjM"); xhr.send(""); alert(xhr.status); } Where YWRtaW46QWRtaW4xMjM is my base64 coded username:password as explained here. If I do not put the authorization line in the code and check

XmlHttp Post in Excel VBA not updating website form

时光怂恿深爱的人放手 提交于 2019-12-19 04:05:11
问题 I routinely have to search the state of NV for unclaimed property and put the results in an Excel spreadsheet. I am trying to automate the process but I'm limited to using Excel 2010 and VBA. Below is the URL to the site I'm trying to submit a form using xmlhttp. URL: https://nevadatreasurer.gov/UPSearch/ I created a class to automate submitting forms on other websites but no matter what I enter in the postdata the form is never submitted. Below is my submission, and method to submit the form

Alternatives for Javascript Synchronous XMLHttpRequest (as timing out in Safari)

孤者浪人 提交于 2019-12-19 04:04:40
问题 Short version: Looking for a method to wait for an Asynch XHR request or a way to get Synch XHR working in Safari. Much longer version: I'm working on a web service that uses various external data sources mashed together. I am using a Javacript front-end which makes AJAX/XHR calls to my PHP server code. There's no cross-site issues as the client only requests data from my server (the server makes the external data requests). I'm using a synchronous XHR request as I have some post-load

Etag header not returned from jQuery.ajax() cross-origin XHR

拜拜、爱过 提交于 2019-12-19 04:02:20
问题 Why is the Etag header not being returned by jqXHR.getAllResponseHeaders() in the following minimal example? Run with: node etag-server.js (then visit http://localhost:8080/ ) etag-server.js var fs = require('fs'), http = require('http'); var webServer = http.createServer(function (request, response) { response.writeHead(200, {"Content-Type": "text/html"}); response.end(fs.readFileSync('frontend.html')); }); var apiServer = http.createServer(function (request, response) { response.writeHead

How secure is a HTTP GET when the data is URL Encoded?

送分小仙女□ 提交于 2019-12-19 03:22:20
问题 If the data is Url Encoded, is it secure enough to send login credentials over HTTP GET? 回答1: Not at all. URL encoded is easily reversible. You should encrypt the transport layer (i.e. use HTTPS) 回答2: No - URL encoding is meant to make sure all the characters you try to send with a GET request can actually arrive at the other end. It is actually designed to be easily encoded and decoded to prepare data for transport, not for security. 回答3: URL encoding is not any kind of encryption, it just