xmlhttprequest

Problem in Loading xml from specified url using javascript in FF & Google Chrome

有些话、适合烂在心里 提交于 2020-01-15 08:19:26
问题 I need to load xml file from specified url using javascript. Here is what i am doing: function GetXMLDoc() { var url = 'http://www.warm.fm/exports/NowOnAir.xml'; var httpRequest = null; try { httpRequest = new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) { try { httpRequest = new ActiveXObject('Microsoft.XMLHTTP'); } catch (e2) { try { httpRequest = new XMLHttpRequest(); } catch (e3) { httpRequest = false; } } } if (httpRequest) { httpRequest.open('POST', url, false); httpRequest

Problem in Loading xml from specified url using javascript in FF & Google Chrome

二次信任 提交于 2020-01-15 08:18:06
问题 I need to load xml file from specified url using javascript. Here is what i am doing: function GetXMLDoc() { var url = 'http://www.warm.fm/exports/NowOnAir.xml'; var httpRequest = null; try { httpRequest = new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) { try { httpRequest = new ActiveXObject('Microsoft.XMLHTTP'); } catch (e2) { try { httpRequest = new XMLHttpRequest(); } catch (e3) { httpRequest = false; } } } if (httpRequest) { httpRequest.open('POST', url, false); httpRequest

How to pass php session with XMLHttpRequest

╄→гoц情女王★ 提交于 2020-01-15 05:15:48
问题 The problem I've got is that I'm calling a php script on my server via XMLHttpRequest from a page that has already a session cookie set. The problem is that the script called by my page creates a new session_id for each call and does not use the existing one to store, the information I want to set, in it. Any solutions? Best regards, pbcoder 回答1: You're probably regenerating the session in your server side file .... can you post the part that checks the session here ? You can set a specific

Shouldn't the error event of xmlhttprequest have an error message?

随声附和 提交于 2020-01-14 09:19:43
问题 I'm working on making an AJAX request from a Firefox extension. I have this code: function GetMenu(){ var oReq = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(); // Setup event handlers - must be set before calling open() oReq.addEventListener("progress", updateProgress, false); oReq.addEventListener("load", transferComplete, false); oReq.addEventListener("error", transferFailed, false); oReq.addEventListener("abort", transferCanceled, false); oReq.open('POST',

Send JSON data to PHP using XMLHttpRequest w/o jQuery

本小妞迷上赌 提交于 2020-01-14 07:47:11
问题 I am trying to send JSON data from a form using the XMLHttpRequest object. I can send the data using the following function. There are no errors displayed in FireBug and the JSON-data in the request is displayed well formed by FireBug. However, I send the data to echo.php , what simply returns the content: <?php print_r($_POST); print_r($_GET); foreach (getallheaders() as $name => $value) { echo "$name: $value\n"; } echo file_get_contents('php://input'); ?> The POST-array is always empty, but

Load local XML file - Chrome 14

喜欢而已 提交于 2020-01-14 03:42:08
问题 I've been trying to get Chrome to load and transform local files. I can attach a style sheet to XML files and that works fine (once the --allow-file-access-from-files switch is added to the command line). However, when trying to load files using xmlHTTPRequest pretty much exactly as in the question Loading local XML file in Chrome (see below), it fails on the line xmlHttp.send(null) . Does anyone know why or can offer assistance? Here's the code from that question: function readxml() {

Ember - Abort ajax request

廉价感情. 提交于 2020-01-13 20:22:31
问题 I want to know how to abort a request. For example, I issue App.MyModel.find() and later i want to cancel/abort it before it returns from server. I would expect something like this: var res = App.MyModel.find(); //request sent to server res.abort(); // abort the request before completion but this doesn't work - the returned object is a promise and there is neither abort nor cancel methods. Clarification I'm looking for how to call the abort method on the underlying XMLHttpRequest object. 回答1:

Ember - Abort ajax request

大兔子大兔子 提交于 2020-01-13 20:22:17
问题 I want to know how to abort a request. For example, I issue App.MyModel.find() and later i want to cancel/abort it before it returns from server. I would expect something like this: var res = App.MyModel.find(); //request sent to server res.abort(); // abort the request before completion but this doesn't work - the returned object is a promise and there is neither abort nor cancel methods. Clarification I'm looking for how to call the abort method on the underlying XMLHttpRequest object. 回答1:

Updating server-side progress on Rails application

孤街醉人 提交于 2020-01-13 11:20:34
问题 I want to upload and then process a file in a Ruby on Rails app. The file upload is usually quite short, but the server-side processing can take some time (more than 20 seconds) so I want to give the user some indicator - something better than a meaningless 'processing...' screen. I'm trying to use the following code in the view <%= periodically_call_remote(:url => {:action => 'progress_monitor', :controller => 'files'}, :frequency => '5', :update => "setProgress('progressBar','5')" ) %> The

React Native Uploading File in parts using XMLHttpRequest and auth digest

北城余情 提交于 2020-01-13 08:02:40
问题 I am trying to upload local mp4/move file with XMLHttpRequest() on a server. This is written with react-native and in final version user would be able to upload any big files from his/her IOS/Android device to server. The file is about 1 GB (it could potentially be from 100 mb to 10 GB). With files below 70 mb I could easily use this code ( below ) to load the blob then slice it and put on server using : https://github.com/inorganik/digest-auth-request sendRequest = new digestAuthRequest('PUT