Viewing data returned by ajax in IE9 - javascript

In Internet Explorer 9, how is it possible to view data that is returned by an ajax script?
For example, in Firefox using Firebug, The 'All' tab has a 'Response' Sub Tab. that show any data returned by an Ajax Script like below. How is it possible to view this in Internet Explorer?
I have a script that is failing in IE9. It's not a bug or error, but it just wont work. I've cleared the cache etc. etc.
{"action":"add","close":false,"success":true}

use developer tools or press f12 and in network tab you can see xhr request captured and in then click go to detailed view button to see the response

Related

How to block a webrequest in chrome webextension after onHeadersReceived without "ERR_BLOCKED_BY_CLIENT"

I try to port my Firefox extension to Chrome but the way of working of webrequestonHeadersReceived doesn't seem to be the same.
When I use:
chrome.webRequest.onHeadersReceived.addListener(analyse,{urls: ["http://*/*", "https://*/*"]},["blocking", "responseHeaders"]);
the function analyse is correctly called and I can analyse the response headers and if the function return "cancel: true", on Firefox the page doesn't update and it is perfect but in Chrome, the page is updating and display the famous message
"Requests to server have been blocked by an extension"
The goal of my extension is to manage some type of downloadable file. But where in Firefox, if you click on download, the page doesn't move and I can display a panel who let you choose what to do, in Chrome even if my panel is correctly displayed, the main page is updated with this error message and I am forced to click on "back" to retrieve the original page.
Furthermore, in Firefox, when a request is blocked one time, it does not try to get again the request, while in Chrome, the page which displays the error message try to get a new the request.

Open response and send again gone in default Firefox Webconsole

Since Firebug has been discontinued, I'm missing two very important pieces of functionality.
I was wondering if there is some replacement available for the following functionality within the default Firefox Web Console.
When a URL was called using Ajax, I had the following options with the URL.
"Open response in new tab" Using this I could open errors that were generated after an AJAX-POST call.
"Resend query" I'm not entirely sure what this function was called, because I used it in Dutch but I used this function to retry AJAX-Calls without having to fill in a form again.
So, is there any way to achieve these two functions in the default Firefox Web Console?
You can access to XHRs in 2 tabs, Console (Web Console) & Network (Network Monitor).
In Console you can see quick view of XHRs. (Headers, Params, Response, Cookies, Call Stack)
In Network tab you can see all requests incl. XHRs. try to select one XHR request, you will see a new column show up in left side with following tabs, Headers, Cookies, Params, Response, Timing & Preview (as Firefox 51.0.1), check the Preview tab, it's great.
Also try to right-click on any XHR in Network tab, you can see few options, incl Edit and Resend and Open in New Tab. this 2 options will be your answer. :)
You can request features/report bugs about Firefox Developer Tools (& of course Firefox) using Bugzilla#Mozilla. Gaps between Firebug and the Firefox DevTools are tracked in bug 991806.

Aborting/Cancelling an AJAX request not working in IE

I have an application where a user is allowed to upload and download documents. In the download area, the user can select multiple files (all pdf), and do a merge and download.
Great.
There is a modal window that pops up during the merge process, that shows the status of the merge, with a progress bar using SignalR. This works fine across all browsers, and the download happens.
Problem: There is a Cancel Merge and Download button on this modal. It stops the SignalR hub, and sends an abort() request to the AJAX call. This works in Safari, Chrome, and FF - but not IE.
When I look at Fiddler, Chrome stops the server side method in it's tracks. In IE, it tries to send that request to SignalR. The result in IE is that the modal window goes away as expected, but a few seconds later you receive the prompt that the file has been downloaded (actual processing never stops). Note the difference where the abort is called in the Fiddler session below.
Fiddler (Chrome - working):
Fiddler (IE - not working):
Javascript:
$('#cancelDownloadMerge').on('click', function () {
$.connection.hub.stop();
XX.Documents.DocumentsView.download.abort();
XX.Documents.DocumentsView.mergeCancelled = true;
XX.Documents.DocumentsView._isMerging = false;
});
The AJAX call that gets fired when Merge And Download is initially clicked is lengthy and proprietary, however, cache: false and crossDomain: true (since currently running localhost) are set as such, yet the problem still persists. I do not think the AJAX call is so much relevant as this is very much isolated to IE, but I can try and post more if needed.
I suspect this has something to do with the fact that Chrome and FF are using ServerSentEvents whereas IE is using forever frame (SSE not supported).
I'm stuck on this one, any help is greatly appreciated.
The problem was due to the fact that SignalR was always defaulting to using Forever Frame in IE. Adding the below restriction forced SignalR to use Long Polling in IE.
$.connection.hub.start({ transport: ['webSockets', 'serverSentEvents', 'longPolling'] });

sending a post request from firefox addon

I am currently working on an addon and it had a addon window with addon buttons and a tab in main window it maintains. I am able to open a page in main tab by
mainWindow().location = "http://murmuring-retreat-7618.herokuapp.com/signin";
I created mainWindow by following way
getBrowser().getBrowserForTab(bridge.recordingTab).contentWindow;
where I have already saved bridge.recordingTab as the tab I am connected.
but if I want to send a post request instead of just open a url, how do I do it?
If you use jQuery in your firefox addon then you could simply do a $.post
Note though that you need the destination server to be CORS enabled, otherwise you can only do JSONP requests using $.getJSON

jQuery $.get() function succeeds with 200 but returns no content in Firefox

I'm writing my first bit of jQuery, and I'm having a problem with jQuery.get(). I'm calling this;
$.get(url, updateList);
where updateList is defined like so;
function updateList(data)
{
if (data)
{
$('#contentlist').html(data);
}
else
{
$('#contentlist').html('<li>Nothing found. Try again</li>');
}
}
The function runs, and updateList is called. It works fine in Internet Explorer. However, in Firefox, the data parameter is always empty. I would expect it to be filled with the content of the webpage I passed in as the URL. Am I using it wrong?
Notes;
in Firebug, I've enabled the Net panel, and I get the request showing up. I get a 200 OK. The Headers tab looks fine, while the Response and HTML panels are both empty.
The page I'm trying to download is a straight HTML page -- there's no problem with server code.
The page with JavaScript is local to my machine; the page I'm downloading is hosted on the Internet.
I've tried checking the URL by copy-pasting it from my page into the browser -- it happily returns content.
The error occurs even in Firefox Safe Mode -- hopefully that rules out rogue addins.
You probably won't be able to do this due to cross-domain security. Internet Explorer will allow you to Ajax remote domain when running from file://, but Firefox and Chrome won't.
Try to put both files on the same server and see if it works (it should).
You'll most likely need to fix your page that you're quering with XHR because it should be returning content. Copy paste the link in the Firebug net tab and make a new tab, and edit that page with your text editor so it spits content back.
Stick alert (or breakpoint in Firebug) and see if the data returned is not an object (or if there is any data). If the former - you may need to drill into the object to get your markup

Categories

Resources