Browser extension for AJAX calls - ajax

I'm looking for browser extension (for Firefox or Google Chrome) that allow me to make AJAX calls. I'd like to specify:
Method (POST/PUT/GET/DELETE)
URL
Data to send (JSON/XML)
I know that I can make AJAX call from console, but it's nice to have dedicated tab for that.

I've found 2 nice extensions:
cREST Client - https://chrome.google.com/webstore/detail/baedhhmoaooldchehjhlpppaieoglhml
XHR POSTER - https://chrome.google.com/webstore/detail/akdbimilobjkfhgamdhneckaifceicen

Related

How to solve Firebug’s “Aborted” messages upon Ajax requests?

I am using Firebug 1.10.2 with Firefox 14.0.1. When showing a web page, the Firebug add-on has this "behavior": Firebug’s “Aborted” message upon Ajax request.
What should I make? Is it so dangerous that I must improve my web application because the presence of some error, or it is a Firebug bug or something else?
Please see the documentation of XHR open() for example here:
https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest
Note: Calling this method an already active request (one for which
open()or openRequest()has already been called) is the equivalent of
calling abort().
Just create a new XHR instance whenever you need one. Better yet, use jQuery or other JS library to do AJAX. It should shield you from these intricacies.
I saw this problem when trying to load a JavaScript file using HTTPS, but was serving the site on my local development environment using HTTP. The request to fetch the JavaScript file would fail with the Aborted message in FireBug. Making the requests use the same protocol worked for me.

Is there a way to find the id of an ajax xmlhttprequest?

One of my pages has about 5 jQuery AJAX calls that fire off as soon as the page loads. I want to track each AJAX call individually and get it an id. How do I do this?
Download the Firefox browser and install the Firebug extension. That will let you track all the XMLHTTP request information for each request (as well as help you with plenty of other debugging issues).
Here's a basic overview: http://getfirebug.com/network

Cross origin AJAX call in Safari extension injected script

I'm trying to figure out right configuration for cross origin AJAX call in Safari extension injected script.
My configuration in Extension Builder:
Extension Website Access: All
Include Secure Pages: true
Whitelist: -
Blacklist: -
My goal is to get something like Chromes "permissions": "http://mysite.com/*", and be able to pull user configuration from web service.
note: JSONP drops warning, so I would prefer to avoid it.
Any luck with this? I'm having the same problems. Same setup works fine in the Chrome extension, but hitting Access-Contol-Allow-Origin when trying to do it in Safari Extension.
FIXED - UPDATE:
Hey, I figured out what the problem is. So, it looks like you need to do the cross-domain ajax via the background page. What I end up doing is determining all the requests I need to make in the injected script, then message pass the requests to the background page. The background page listens for messages from the injected script, makes the appropriate ajax calls, and then sends the results via a message to the injected script. The injected script is then listening for messages from the background page, once it gets the message(s) with the ajax results, it takes the appropriate action in the page that's being viewed.

How can I watch (i.e. debug) xmlHttpRequest() actions in IE8 ? (using Firebug Lite)

I normally do my web dev using Firefox - I periodically test for cross browser compatability of my pages by using FF and IE.
I have just found that one of my AJAX pages stopped working in IE - although it works fine in FF. With FF, I always use FireBug to debug my Ajax interactions. I am looking for a similar tool to use with IE - to see what it is causing it to fail, even though it is a straightforward AJAX process on the page.
I downloaded Firebug Lite and that was very helpful, as it brought a familiar dev environment into IE. Unfortunately, I have not been able to debug my AJAX interactions following the ForebugLite's documentation:
firebug.watchXHR: Use this function to watch the status of XmlHttpRequest objects.
var req = new XmlHttpRequest;
firebug.watchXHR(req);
I inserted that in my page - so the top of my page looks like this:
<script type='text/javascript'
src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'>
var req = new XmlHttpRequest;
firebug.watchXHR(req);
</script>
However, I still could not debug the AJAX interactions (i.e. nothing shows in the console window when I click on a link that triggers an AJAX call).
Has anyone managed to do this before (IE7 and Firebug Lite)?
Or, you could install Fiddler and watch all of your web traffic.
Try DebugBar - I think it will capture this.
To use Firebug lite, you have to attach Firebug to each XHR request. So you'll wanna call firebug.watchXHR(req); for each ajax request you make, before you fire the request.
If you are using a library such as Jquery or Prototypejs to make your Ajax requests, you can wire Firebug lite into the process for easy debugging.
charles is another option for studying your network traffic but debugBar would probably be my choice.

Iframe vs normal / ajax get request

I have a page that gathers environment status from a couple of IBM WebSphere servers using iframes similar to this:
<iframe src="http://server:9060/ibm/console/status?text=true&type=server&node=NODE&name=ServerName_server_NODE"></iframe>
and it happily prints out "Started" or "Unavailable" etc. But if I load the same url in a normal browser sometimes it works, sometimes it does not? Some of them are showing a login page, while others are simply return HTTP code 500.
So whats the difference between loading the page through an iframe vs through a browser?
I can tell you that the iframe solution works no matter which machine I am doing it on, so I do not belive it has anything to do with the user whos opening the page. And before you ask, why not keep the solution that works, well its because it takes a long time to open the page with the iframes vs a page where everything is requested through ajax.
Update: Using jQuery to perform the ajax call returns "error" and "undefined" for the servers that I can't see in a normal browser.
One difference is an iframe has to render the view while XHR would not.
An iframe is essentially the same as opening with the browser. In both cases the browsers credentials are used, so there will be no difference between the two.
Secondly, loading something in an iframe should take the same amount of time as requesting it through XHR, since in both cases the browser makes an HTTP request and waits for the response. Although I should add that an iframe will take time to render the content onto the page. However if you plan on displaying it with ajax anyways, an iframe/xhr solution will be more or less the same.
In case of ajax request same origin policy (which restricts cross domain call) comes into picture. So you can't make cross domain call using xhr. Alternative for same is embed flex swf file in your page as activex control and make flex call through javascript and then flex is responsible to make cross domain call (flex can if targeted domain allows cross domain using crossdomain.xml) and renders result using javascript again.

Resources