Calling WebService from javascript

I am developing a Firefox addon that needs to interact with an external WebService The
WebSerivce is created using an ASP.NET page (.asmx)

I cannot use ajax because it is an addon and not a website.
Does anyone know how to do this?

+1


a source to share


4 answers


Check out this link: It clearly states that XMLHttpRequest can be used from Mozilla extensions. https://developer.mozilla.org/En/Using_XMLHttpRequest#Downloading_JSON.c2.a0and_JavaScript_from_extensions



+1


a source


If you want to do it manually, you need to use XMLHttp Object . This can get quite painful, however, and it is for this reason that there are many Javascript libraries to make the task of receiving and sending data less painful.



+2


a source


You will need to consider cross domain issues initiating a call from your add-in to a service.

The XMLHttpRequest object is one of the basic building blocks of AJAX. I'm not sure about the isolation of your Add-On, but it seems strange that you won't be able to use it.

The language generated by the web service is not important, you just need to know what kind of web service protocol it requires. Just like when you visit a website you can be agnostic, be it php, asp or jsp generating HTML, you just need to know how to handle HTML.

+1


a source


0


a source







All Articles