I am fiddling around with a 'list'-function in couch handling linked documents. Documents and their linked 'neighbors' are screened. It works all fine.
So, I thought I would extend it a little and let some representative 'neighbor'-data be screened rather than the _id:xxx..
My thought was to use jQuery.ajax() and feed it the _id:xxx to return the data I wanted and then let the list-function send that to be screened.
In the top of the 'lib/lists.js' I place $=require('jQuery') and in the kanso.json the jquery package is included and 'installed' before the push but this only results in window not defined.
OK. It could be that there does not exist any window-object in the lists.js, but what to do then? Should I write an XHRHttpRequest in javascript directly or let lists.js result on a webpage where jQuery can be called in the <script>jQuery code here..</script> and find the elements wanted, read the _id:xxx, fetch wanted data and replace _id:xxx with the wanted data?
Both solutions seems rather 'write more, don't do so much actually'. Suggestions?