xmlhttprequest

Ajax not working with wunderground API (A Weather service to get information and display)

限于喜欢 提交于 2019-12-13 02:32:53
问题 Hello there!. I am trying to use a public api from wunderground (more info in [http://wiki.wunderground.com/index.php/API_-_XML][1]) on a web page (in fact in a widget for a phone, but for testing purposes, but is the same technically speaking and writing code). The main question is that i haven't been able to get the ajax request work, i try using a plain request (without any library) and request using jquery; as you can guess: no one works. I am getting really frustrating with this. I know

VBA - Number of Google News Search Results

一世执手 提交于 2019-12-13 01:56:25
问题 I have a cell that contains something I would like searched in google news. I want the code to return the number of results for that search. Currently I have this code which I found elsewhere on the site and does not use google news but even then I sometimes get a runtime error -2147024891 (80070005) after 70 or so searched and I can't run again. Sub HawkishSearch() Dim url As String, lastRow As Long Dim XMLHTTP As Object, html As Object Dim start_time As Date Dim end_time As Date lastRow =

Encoding “<” and “>” while sending XML via HTTP Post

别来无恙 提交于 2019-12-13 01:53:45
问题 I am sending an XML content via HTTP Post from Access VBA to Web Methods, using XMLHTTP object in MSXML. Here is the Code. Dim objXmlHttp As Object Set objXmlHttp = CreateObject("MSXML2.ServerXMLHTTP") objXmlHttp.Open "POST", webServicePath, False objXmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" Dim Response As String objXmlHttp.send wrt.output 'OK status If objXmlHttp.Status = 200 Then Response = objXmlHttp.responseText End If Set objXmlHttp = Nothing I am

CORS issue: No 'Access-Control-Allow-Origin' header is present on the requested resource

ぃ、小莉子 提交于 2019-12-13 01:30:35
问题 var enableCORS = function(req, res, next) { res.header('Access-Control-Allow-Origin', '*'); res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS'); res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization, Content-Length, X-Requested-With'); // intercept OPTIONS method if ('OPTIONS' == req.method) { res.send(200); } else { next(); } }; app.use(enableCORS); I found out to use the following snippet in the server side, but still when i try to POST I am getting

How do I return the response from an asynchronous call?

大憨熊 提交于 2019-12-13 01:25:32
问题 I have a function foo which makes an Ajax request. How can I return the response from foo ? I tried returning the value from the success callback as well as assigning the response to a local variable inside the function and returning that one, but none of those ways actually return the response. function foo() { var result; $.ajax({ url: '...', success: function(response) { result = response; // return response; // <- I tried that one as well } }); return result; } var result = foo(); // It

XmlHttpRequest Upload Hangs After Pause Between Uses

穿精又带淫゛_ 提交于 2019-12-13 00:49:26
问题 I am working on a single page application with a file upload portion. Knockout is used to bind the view to a viewmodel. This application is an intranet application using Windows Authentication and IE10 as the client. If the user initially uploads a file, all is well. If, after 1 upload, there is a 1 minute or more pause and another upload is attempted, the application will hang. Here is my file upload code: var fileToUpload = document.getElementById(fileInputID).files[0]; var formData = new

how to compare xmlhttp.responsetext?

狂风中的少年 提交于 2019-12-13 00:39:50
问题 my code- document.getElementById("lblmsg").innerHTML=xmlhttp.responseText; if(xmlhttp.responseText == 'Available') { document.getElementById("newid").value = ""; } although response text is Available but still it is not going inside if condition??? 回答1: Well, that should work. Are you sure that the response text is exactly Available? Try trimming the response like this: if(xmlhttp.responseText.trim() == 'Available') Do you have access to firebug? Try a console.log(xmlhttp) to find out the

getting bad request from ruby on rails ssl post

不问归期 提交于 2019-12-13 00:23:21
问题 Looked at: Escaping parameters in set_form_data POST, and Ruby on Rails HTTPS Post Bad Request def send_request(params) host = "https://hc.mercurydev.net" uri = URI.parse(host) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE xml = build_xml_for_checkout(params) http.start do |http| req = Net::HTTP::Post.new('http://www.mercurypay.com/InitializePayment') header = {'Host' => 'hc.mercurydev.net', 'Content-Type' => 'text/xml; charset=utf-8

Chrome doesn't seem to fire javascript xmlhttprequests after a form submit, but FF and IE do

倖福魔咒の 提交于 2019-12-13 00:19:05
问题 I use this little trick to update the current page while the next page is loading. When the user clicks submit, I set an interval timer which does xhr calls to the server to find out how much longer the response is going to take and update the page with this information, thus successfully entertaining the user. In Firefox and IE this works fine, but it seems in chrome after the form submit happens, the setinterval call will still fire but the xmlhttprequest never actually performs the request

What are differences between XMLHttpRequest and HttpRequest

久未见 提交于 2019-12-13 00:12:13
问题 In Zend Framework and other framework such as Symfony, there is a method named isXMLHttpRequest() to determine this is XMLHttpRequest or not. I wonder that how can framework or PHP distinguish between XmlHttpRequest and HttpRequest? if($this->_request->isXmlHttpRequest()) { //code here } 回答1: From the documentation: Zend_Controller_Request_Http has a rudimentary method for detecting AJAX requests: isXmlHttpRequest(). This method looks for an HTTP request header X-Requested-With with the value