xmlhttprequest

Passing “(” and “)” through a URI causes a 403 error, how can I encode them?

只谈情不闲聊 提交于 2019-12-23 03:44:09
问题 (JavaScript for the XML HTTP request and PHP for the execution SQL query.) I'm building a web app that executes queries. It uses the XMLHTTP request GET method and passes a query to a PHP script that executes it. It works fine until I introduce parentheses ( ) in it. Here is an example of how works: function executeQry(){ qry = document.getElementByID('textarea').value; qryHTTPRequest(encodeURI(qry)); //I've also tried encodeURIComponent(qry); } function xmlHTTPRequest(qry){ //fetches

Trying to upload multiple images using XHR 2 and PHP

本小妞迷上赌 提交于 2019-12-23 03:12:50
问题 I'm having problems trying to upload files using the latest XHR 2 along with PHP. My code is as follows: HTML... <!doctype html> <html> <head> <title>XHR Multiple File Upload</title> <link rel="stylesheet" type="text/css" href="upload.css"> </head> <body> <input type="file" id="upload" multiple="true" accept="image/*"> <a href="#" id="upload-link">Click here to upload multiple files</a> <script src="upload.js"></script> </body> </html> JavaScript var formdata, link, input, doc = document; if

Tomcat maxpostsize value ignored with XMLHttpRequest?

天涯浪子 提交于 2019-12-23 03:12:21
问题 I am developing a web application with Spring 3 and jquery and i am using an ajax upload script to send files to the server (Tomcat 7.0.22). A file is posted to the server with a content-type of application/octet-stream and the server parses it fine as a byte array. However although i have even explicitly set in the tomcat configuration the value of maxpostsize to 2097152, this setting appears to have no effect at all. For example i am able to upload files (locally) large enough (> 1 GB) to

Tomcat maxpostsize value ignored with XMLHttpRequest?

橙三吉。 提交于 2019-12-23 03:12:08
问题 I am developing a web application with Spring 3 and jquery and i am using an ajax upload script to send files to the server (Tomcat 7.0.22). A file is posted to the server with a content-type of application/octet-stream and the server parses it fine as a byte array. However although i have even explicitly set in the tomcat configuration the value of maxpostsize to 2097152, this setting appears to have no effect at all. For example i am able to upload files (locally) large enough (> 1 GB) to

modify the post data of a request in firefox extension

谁都会走 提交于 2019-12-23 02:53:09
问题 I am trying to trap an http request, change some of its post parameters and send the modified request. I tried using the setData method of upload stream to modify the request, but the same original request is sent. I have the following code execute on the "http-on-modify-request" : //rewind the request to read post body channel= subject.QueryInterface(Components.interfaces.nsIHttpChannel); channel=channel.QueryInterface(Components.interfaces.nsIUploadChannel); channel = channel.uploadStream;

Should I send additional headers with XmlHttpRequest POST?

夙愿已清 提交于 2019-12-23 02:53:05
问题 After opening XmlHttpRequest POST connection var http = new XMLHttpRequest(); http.open("POST", url, true); Some recommend to include these additional headers before sending the request: http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.setRequestHeader("Content-length", params.length); http.setRequestHeader("Connection", "close"); Is it necessary on Apache+PHP server? It works fine on my server without those headers. 回答1: your code works fine without headers

How to search for string in html files using Javascript?

爱⌒轻易说出口 提交于 2019-12-23 02:49:11
问题 I have 5 html files and I have a search form that I would like to use to search for text in these html files . <form> <input type ='text' /> <input type ='submit' /> </form> I have an idea of using xmlhttprequest to get the files var xhr = new XMLHttpRequest(); xhr.open("GET", "file1.html", false); xhr.send(); var guid = xhr.responseText; var xhr = new XMLHttpRequest(); xhr.open("GET", "file2.html", false); xhr.send(); var guid = xhr.responseText; ... then search for text in these files but I

How to animate chrome extension icon in a callback function?

╄→гoц情女王★ 提交于 2019-12-22 18:38:50
问题 This is a follow up to my previous question about using XMLHttpRequest() to post to my bookmarking app. When I receive the status 200 OK I want to indicate somehow with a change in the extension icon that the request was successful. I created another icon success_icon.png with reverse colors and I am trying to make the new icon replace the original icon and fade into original icon. I understand that this will be inside my callback function but I don't understand how? Here's my background.html

AngularJS and Laravel - crossdomain CORS / XHR requests lacking (remember_) cookies

强颜欢笑 提交于 2019-12-22 17:59:59
问题 My CORS / XHR requests lacking the remember_xyz cookie in the request headers when i don't use the --disable-web-security option in chrome. If i enable that option the remember_xyz cookie will be included in the request headers and everything is working fine. As workaround i'm currently sending the auth credentials via basic auth header. But i think that's not the intended or right way. How can i get that remember cookie included in the request headers? Edit: In chrome's network console i can

XHR requests fail when an ADFS authenticated session expires

帅比萌擦擦* 提交于 2019-12-22 13:53:06
问题 We have a site which relies on federated authentication using Active Directory Federation Services (ADFS) and WSFederationAuthenticationModule. The site also employs a set of XHR requests fired upon user interaction. One particular example is a drop-down menu which allows the user to impersonate other users. Another one is the faceting functionality on a site-wide search page. The problem is that the session expires when a user stays inactive on a page for certain amount of time. In normal