Search Results

Search found 288 results on 12 pages for 'xhr'.

Page 1/12 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Determining full XHR request URL on a Google Chrome XHR Breakpoint

    - by DanH
    I am initiating a jQuery ajax ($.ajax) post, within the Google Chrome browser. I have setup a XHR breakpoint in the "XHR Breakpoints" section of the "Scripts" tab within the Developer Tools. The criteria of the breakpoint is "get" ie. I want the debugger to break on all XHR requests which contain the word "get" in them (somePage.asmx/getListOfAnimals) is an example. The breakpoint is being correctly hit, however I am unable to determine what the exact URL that is being requested. I realize I can remove the breakpoint and see what URL is being requested from the "Network" tab, but I want to know this at the time the breakpoint is hit. I have tried stepping through the XHR request once it has been hit in Chrome, but I must be missing a Javascript object/property which contains the fully requested URL. Google Chrome has detected that the XHR requested URL contains "get" but how do I get to this URL from within the debug session before the request is made?

    Read the article

  • Firefox redirect response on xhr request

    - by Bogdan Gusiev
    Suppose we have the xhr 'POST' request that returns 'redirect' status code. In that case browser is sending additional xhr 'GET' by the given URL. I am not sure who is doing that call chain: browser itself or js library(using MooTools). The problem is that the second 'GET' request is not recognized as xhr by the server: It doesn't have "X-Requested-With" header contains "XMLHttpRequest" The problem appears only on Firefox, but not on Webkit. So, believe it is not related to js library bug. Does anyone have ideas how to fix it?

    Read the article

  • JSON Feed Appears to be XHR when it should be JS

    - by Oscar Godson
    I don't get why it'd doing this with the 2nd feed (appearing as a XHR call rather than just JS [looking at it in Firefox/Firebug]). The 2nd feed has the exact same MIME type as Flickr's JSON feed, yet the PortlandOregon.gov one shows as XHR and i get a NULL callback when using $.getJSON and if i use $.ajax with a 'json' or 'jsonp' type i get nothing at all. If i do the Flickr one i get the normal "[object Object]" callback. Whats going on? Please help! This has been such a headache for about a week. And i have authorization to change the feed, but i have to request the change, so if anyone knows for absolute sure let me know that! Response Headers from Flickr's API ( http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=? ) [JS]: Date Mon, 15 Mar 2010 21:56:06 GMT P3P policyref="http://p3p.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV" Expires Mon, 26 Jul 1997 05:00:00 GMT Last-Modified Mon, 15 Mar 2010 21:52:17 GMT Cache-Control no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma no-cache Vary Accept-Encoding Content-Encoding gzip Content-Length 3647 Connection close Content-Type application/x-javascript; charset=utf-8 Request Headers Host api.flickr.com User-Agent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 Accept */* Accept-Language en-us,en;q=0.5 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive 115 Connection keep-alive Referer http://oscargodson.com/dev/addWidget/test.html Cookie BX=4lflj455amesp&b=3&s=iv; fltoto=0%2C0%2C0%2C0%2C1%2C0%3B0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%2C0%3B1%3B0%3B; search_z=t; localization=en-us%3Bus%3Bus PortlandOregon.gov ( http://www.portlandonline.com/shared/cfm/json.cfm?c=27321 ) [XHR]: Response Headers Connection close Date Mon, 15 Mar 2010 21:57:49 GMT Server Microsoft-IIS/6.0 Set-Cookie CONTACT_ID=0;path=/ LAST_USER=;path=/ BIGipServercgis_pol_web_pool-http=1191537418.20480.0000; path=/ Content-Type application/x-javascript; charset=utf-8 Request Headers Host www.portlandonline.com User-Agent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 Accept application/json, text/javascript, */* Accept-Language en-us,en;q=0.5 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive 115 Connection keep-alive Referer http://oscargodson.com/dev/addWidget/test.html Origin http://oscargodson.com

    Read the article

  • jQuery Ajax Methods Not Returning XHR Object

    - by Nate
    UPDATE: I haven't figured out what's going on, but this definitely seems to be a problem with my project. After creating a simple test page, I was able to verify that getJSON does in fact return an XHR object like it's supposed to. Per the stackoverflow question/answer here: Kill ajax requests using javascript using jquery. and a number of other question/answers on this site and others, the jQuery Ajax methods should return the XHR object. However, when I run the following code, request is "undefined". var request = $.getJSON(url, function(data) { console.log(data); }); console.log(request); Did I miss a change in jQuery? I'm using 1.4.4.

    Read the article

  • JSON Object XHR and closures

    - by Sara Chipps
    Hi all, I have a JSON object that is populated by an XHR. I then need to update that object with values from a separate XHR call. The issue I am running into is the second call isn't being made at the correct time and I think it's an issue with how I structured my object. Here is what I have: function Proprietary() { var proprietary= this; this.Groups = {}; this.getGroups = function() { $.getJSON(group_url, function(data){proprietary.callReturned(data);}); } this.callReturned = function(data) { //Do stuff for(var i=0; i< data.groups.length; i++) { insparq.Groups[i] = data.groups[i]; $.getJSON(participant_url, function(p){proprietary.Groups[i].participants = p;}); } //the function call below is the action I want to occur after the object is populated. PopulateGroups(); } };

    Read the article

  • XHR FF POST size limit

    - by usurper
    Hi, My XHR POST REQUEST is cut off. When I try to reload my page information is missing. Firebugs sends following message: ... Firebug request size limit has been reached by Firebug. ... My question is: What are my options? Would it work if I declare the content.length in the header? I added a line to my apache config file and restarted it: LimitRequestBody 0 I increased the size of transfer files in mysql config file Or it is a browser issue? The only solution I could think of was to cut the data in pieces and transmit the array one by one but I don't like this idea. The content length is 91691 according to firebug. Any suggestions?

    Read the article

  • TinyMCE not working in http request xhr ajax generated page

    - by user982853
    So i I have a page that contains links that call an httpRequest. The request calls a php file that grabs data from mysql and pre populates a form which is then returned to the browser/webpage. My problem is that when the page is returned to the browser via the httpRequest/ajax the text area does not display the tinymce editor, it just displays a normal text area. It looks like my request and ajax is working fine the text area just doesn't have the tinycme editor on it. When i don't use ajax it works fine but when i put it in a separate file and call it via ajax it doesn't bring in the tinymce editor. Does anyone know how to fix this problem so that my ajax generated page displays the text area with the tinymce editor. Thank you.

    Read the article

  • bing search api ajax does not work

    - by jhon
    Hi guys, I want to use the Bing's search api with javascript. Actually, I want the user to write something and query Bing in order to get just images. so, I tried it using ajax. If I try the url http://api.search.live.net/xml.aspx?Appid=[YOURAPIKEY]&sources=image&query=home directly (with the browser) I do get an xml document. but if I use XMLHttpRequest it does not work. <html> <body> <script> var xhr = new XMLHttpRequest(); var url="http://api.search.live.net/xml.aspx?Appid=[YOURAPIKEY]&sources=image&query=home" xhr.open("GET", url, true ); xhr.onreadystatechange=function(){ /*if( xhr.readyState == 4 && xhr.status == 200) { document.write( xhr.responseText ); }*/ alert( xhr.readyState +" "+xhr.status +xhr.statusText +xhr); }; xhr.send(null); </script> </body> </html> Questions: 1) why does the code from above does not work? 2) any other way to do this without XMLHttpRequest? thanks. btw. I'm just interested in fix this for Firefox and without external libraries (jquery and so on).

    Read the article

  • Paperclip and xhr.sendAsBinary

    - by Denis
    Hi, I use paperclip to add a file to my model. I want to use the new feature of firefox 3.6, xhr.sendAsBinary, to send a file with an ajax request. Here is how I build my request : var xhr = new XMLHttpRequest(); xhr.open("POST", "/photos?authenticity_token=" + token + "&photo[name]=" + img.name + "&photo[size]=" + img.size); xhr.overrideMimeType('text/plain; charset=x-user-defined-binary'); xhr.sendAsBinary(bin); name and size are saved in my model without problem but the file itself is not catched by paperclip. my model class Photo < ActiveRecord::Base has_attached_file :photo, :styles => { :medium => "300x300>", :thumb => "100x100>" } end the migration def self.up add_column :photos, :photo_file_name, :string add_column :photos, :photo_content_type, :string add_column :photos, :photo_file_size, :integer add_column :photos, :photo_updated_at, :datetime end and my controller # POST /photos # POST /photos.xml def create @photo = Photo.new(params[:photo]) respond_to do |format| if @photo.save format.html { redirect_to(@photo, :notice => 'Photo was successfully created.') } format.xml { render :xml => @photo, :status => :created, :location => @photo } else format.html { render :action => "new" } format.xml { render :xml => @photo.errors, :status => :unprocessable_entity } end end end Any idea how to solve this issue? Thanks

    Read the article

  • In XHR, is it possible to distinguish network errors from cross-origin errors?

    - by greim
    http://www.w3.org/TR/access-control/ Reading the CORS spec linked above, it seems to be the case that it's impossible to reliably distinguish between a generic "network error" and a cross-origin access denied error. From the spec: If there is a network error Apply the network error steps. Perform a resource sharing check. If it returns fail, apply the network error steps. http://www.w3.org/TR/access-control/#simple-cross-origin-request0 In my testing, I couldn't locate any features of Firefox's implementation that seem to indicate that the resource sharing check definitely failed. It just switches readyState to 4 and sets status to 0. Ultimately I'd like the ability to pass a success callback, a general fail callback, and an optional cross-origin fail callback, to my function. Thanks for any help or insight.

    Read the article

  • jQuery error when aborting an ajax call only in Internet Explorer

    - by Rob Crowell
    When mousing over an image in a jcarousel, my site displays a popup whose contents are loaded via ajax. I'm doing what I thought was fairly straightforward; keeping a handle to the xhrRequest object, and aborting the existing one before making a new request. It works great in all browsers except IE, where I receive an error "Object doesn't support this property or method" Here's the code that is triggering it: function showPopup { // ... code snipped ... // cancel the existing xhr request if (showPopup.xhrRequest != null) { showPopup.xhrRequest.abort(); showPopup.xhrRequest = null; } showPopup.xhrRequest = $.ajax({url: url, type: "GET", success:function(data) { $("#popup-content").html(data); } }); // ... code snipped ... } showPopup.xhrRequest = null; Works great in Firefox and Chrome. I traced the error down to this bit of code in jquery.js inside the ajax function (line 5233 in my copy of jQuery): // Override the abort handler, if we can (IE doesn't allow it, but that's OK) // Opera doesn't fire onreadystatechange at all on abort try { var oldAbort = xhr.abort; xhr.abort = function() { if (xhr ) { oldAbort.call( xhr ); } onreadystatechange( "abort" ); } catch(e) { } The specific error occurs on the oldAbort.call( xhr ) line. Any ideas?

    Read the article

  • Can a script called by XHR reference $_COOKIE?

    - by Christian Mann
    Quick yes/no - I'm building an AJAX application and some scripts require authentication. Can I read $_COOKIE['username'] and $_COOKIE['password'] on the server if the PHP script was called via XHR, whether that be $.get() or $.post()? Side question: Can it also set cookies? Is that considered "good practice"?

    Read the article

  • how do I access XHR responseBody from Javascript?

    - by Cheeso
    I've got a web page that uses XMLHttpRequest to download a binary resource. Because it's binary I'm trying to use xhr.responseBody to access the bytes. I've seen a few posts suggesting that it's impossible to access the bytes directly from Javascript. This sounds crazy to me. Weirdly, xhr.responseBody is accessible from VBScript, so the suggestion is that I must define a method in VBScript in the webpage, and then call that method from Javascript. See jsdap for one example. var IE_HACK = (/msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent)); if (IE_HACK) document.write('<script type="text/vbscript">\n\ Function BinaryToArray(Binary)\n\ Dim i\n\ ReDim byteArray(LenB(Binary))\n\ For i = 1 To LenB(Binary)\n\ byteArray(i-1) = AscB(MidB(Binary, i, 1))\n\ Next\n\ BinaryToArray = byteArray\n\ End Function\n\ </script>'); var xml = (window.XMLHttpRequest) ? new XMLHttpRequest() // Mozilla/Safari/IE7+ : (window.ActiveXObject) ? new ActiveXObject("MSXML2.XMLHTTP") // IE6 : null; // Commodore 64? xml.open("GET", url, true); if (xml.overrideMimeType) { xml.overrideMimeType('text/plain; charset=x-user-defined'); } else { xml.setRequestHeader('Accept-Charset', 'x-user-defined'); } xml.onreadystatechange = function() { if (xml.readyState == 4) { if (!binary) { callback(xml.responseText); } else if (IE_HACK) { // call a VBScript method to copy every single byte callback(BinaryToArray(xml.responseBody).toArray()); } else { callback(getBuffer(xml.responseText)); } } }; xml.send(''); Is this really true? The best way? copying every byte? For a large binary stream that's not gonna be very efficient. There is also a possible technique using ADODB.Stream, which is a COM equivalent of a MemoryStream. See here for an example. It does not require VBScript but does require a separate COM object. if (typeof (ActiveXObject) != "undefined" && typeof (httpRequest.responseBody) != "undefined") { // Convert httpRequest.responseBody byte stream to shift_jis encoded string var stream = new ActiveXObject("ADODB.Stream"); stream.Type = 1; // adTypeBinary stream.Open (); stream.Write (httpRequest.responseBody); stream.Position = 0; stream.Type = 1; // adTypeBinary; stream.Read.... /// ???? what here } I don't think that's gonna work - ADODB.Stream is disabled on most machines these days. In The IE8 developer tools - the IE equivalent of Firebug - I can see the responseBody is an array of bytes and I can even see the bytes themselves. The data is right there. I don't understand why I can't get to it. Is it possible for me to read it with responseText? hints? (other than defining a VBScript method)

    Read the article

  • XHR readyState = 4 but Status = 0 in Google Chrome Browser

    - by Jay
    Hello i'v got a strange Problem with an AJAX call on my site. I make a simple AJAX call to a Script on my site. But the AJAX call fails with readState=4 and Staus = 0. There's no cross domain problem because the script i want to call is on my server. $.ajax({ type:"GET", url: 'http://mydomain.com/test.php', success : function(response){ console.log(response); }, error : function(XHR){ console.log(arguments); } }); I 've googled a lot of sites but there seems to be no solution for that!

    Read the article

  • jQuery.ajax checking if there is already another xhr

    - by digitalFresh
    I have a page when, if the user is near the bottom of the page, loads the next page. I just recently switched it to jQuery, and now use the jQuery.ajax() function to get the data. However, now i cannot check if the xhr is already loading, making the page load multiple xhrs when the user near the bottom. My listener is: $(document).scroll(function () { if(/* scrollbar is near bottom */) loadxhr(dat++); //function that calls jQuery.ajax() } }); Basically, can you track the readyState of the call in a global scope?

    Read the article

  • Connection Timeout Extension/Detection

    - by ircmaxell
    Well, let me start off by explaining what I'm trying to do. I have an application that stalls a HTTP connection until new data is available (sometimes a few seconds, sometimes 30 minutes or so). Right now, the system works fine if the data is sent within a few minutes. The problem I'm facing, is that it doesn't seem that XHR recognizes a dropped connection... So instead of killing the current connection and reconnecting when it detects a dropped connection, it just sits there. I'd really not like to have it force-reconnect every minute or two (That's one reason this app was written, to stop the need for polling). So, my questions are as follows: Is there a way to detect a dropped (not closed) TCP connection with XHR? Is there a way that I can tell XHR not to timeout (I saw IE8 has the .timeout property) Would it be better to send a header (or some other content) every now and then (say once per minute) down the pipe to keep the connection open? Thanks.

    Read the article

  • Modifying jQuery ajax request Connection header

    - by Pat
    I'm trying to modify the Connection header with the following code with no success jQuery.ajax({ url: URL, async: boolVariable, beforeSend: function(xhr) { xhr.setRequestHeader("Connection", "close"); } }) The request headers via Firebug show: Connection keep-alive X-Requested-With XMLHttpRequest Any odd bugs/problems with setting this particular header known? Or is there something I'm doing wrong?

    Read the article

  • RequestBuilder timeouts and browser connection limits per domain.

    - by WesleyJohnson
    This is specifically about GWT's RequestBuilder, but should apply to general XHR as well. My company is having me build a near realtime chat application over HTTP. Yes, I do realize there are better ways to do chat aplications, but this is what they want. Eventually we want it working on the iPad/iPhone as well so flash is out, which rules out websockets and comet as well, I think? Anyway, I'm running into issues were I've set GWT's RequestBuilder timeout to 10 seconds and we get very random and sporadic timeouts. We've got error handling and emailing on the server side and never get any errors, which suggests the underlying XHR request that RequestBuilder is built on, never gets to the server and times out after 10 seconds. We're using these request to poll the server for new messages rather often and also for sending new messages to the server and also polling (less frequently) for other parts of application. What I'm afraid of is that we're running into the browsers limit on concurrent connections to the same domain (2 for IE by default?). Now my question is - If I construct a RequestBuilder and call it's send() method and the browser blocks it from sending until one of the 2 connections per domain is free, does the timeout still start while the request is being blocked or will it not start until the browser actually releases the underlying XHR? I hope that's clear, if not please let me know and I'll try to explain more.

    Read the article

  • sending a selected value from a dropdownlist to a servlet with xhr

    - by kawtousse
    I am trying to send the clicked value of a dropdown list to my servlet to run a SQL query using the value received. To do it I am using Ajax like that: function showProject(prj) { xmlhttp = GetXmlHttpObject(); if (xmlhttp == null) { alert ("Browser does not support HTTP Request"); return; } var url = "ServletxmlGenerator.java"; idprj = prj.options[prj.selectedIndex].value; url = url + "?idprj=" + idprj; xmlhttp.onreadystatechange = stateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } The servlet when String projectcode=(String) request.getParameter("idprj"); returns null. When I select a value from the JSP that construct the dropdown list and from which the function showProject is handled the same thing is happned. It returns always null. So the parameter(idprj) is not passed anyway. How can I handle with this. I need to send the selected value to the servlet to run my SQL query.

    Read the article

  • WebKit "Refused to set unsafe header "content-length"

    - by Paul
    I am trying to implement simple xhr abstraction, and am getting this warning when trying to set the headers for a POST. I think it might have something to do with setting the headers in a separate js file, because when i set them in the <script> tag in the .html file, it worked fine. The POST request is working fine, but I get this warning, and am curious why. I get this warning for both content-length and connection headers, but only in WebKit browsers (Chrome 5 beta and Safari 4). In Firefox, I don't get any warnings, the Content-Length header is set to the correct value, but the Connection is set to keep-alive instead of close, which makes me think that it is also ignoring my setRequestHeader calls and generating it's own. I have not tried this code in IE. Here is the markup & code: test.html: <!DOCTYPE html> <html> <head> <script src="jsfile.js"></script> <script> var request = new Xhr('POST', 'script.php', true, 'data=somedata', function(data) { console.log(data.text); }); </script> </head> <body> </body> </html> jsfile.js: function Xhr(method, url, async, data, callback) { var x; if(window.XMLHttpRequest) { x = new XMLHttpRequest(); x.open(method, url, async); x.onreadystatechange = function() { if(x.readyState === 4) { if(x.status === 200) { var data = { text: x.responseText, xml: x.responseXML }; callback.call(this, data); } } } if(method.toLowerCase() === "post") { x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); x.setRequestHeader("Content-Length", data.length); x.setRequestHeader("Connection", "close"); } x.send(data); } else { // ... implement IE code here ... } return x; }

    Read the article

  • Removing DOM event handlers in long-running browser session

    - by Chris Beck
    I have a browser interface with a ul#contacts list on the left and div#contact property panel (email, phone) on the right. Click a contact in the list and my app makes an XHR request to get the contact property HTML fragment and update div#contact.innerHTML. Each contact fragment has an "Edit Contact" link. With JS, I progressively upgrade that link with an event listener that performs an XHR request to replace the static property panel with an in-place edit form. This can happen many times during a single browser session. How should I clean up my "Edit Contact" event listener? Do I need to remove it manually before the form overwrites the property panel? Or is the event listener cleaned up automatically when the contents of div#contact (and the node that I'm listening on) is overwritten? FWIW, I still consider IE6 to be part of my target market.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >