couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hank Knight <>
Subject CouchDB: Using XMLHttpRequest in Show Functions
Date Mon, 20 Jan 2014 16:29:54 GMT
I discovered that new functions can be made available to all show and
list functions by modifying:

I have attached an example.  To test it, replace your version of
"main.js" with the one I attached.

Then create a design document like the one I attached.

Test it like this:

This causes the custom function in main.js to be executed and it
returns a result.

I want to use this method to retrieve data, like this:

function getPage(url) {
 var req = new XMLHttpRequest();"GET", url, false);

Everything works until I use XMLHttpRequest.  Then I get an error:
XMLHttpRequest is not defined

How can I gain access to XMLHttpRequest from main.js?

View raw message