Subj : Re: Making a Spider in Java with Rhino To : gonzalo From : Igor Bukanov Date : Tue Mar 25 2003 03:12 pm gonzalo wrote: > Hi Again > > So, i manage to get de js code from the web page, even the js > libraries from the server, BUT when calling the interpreter, I get > this error: > > ReferenceError: "document" is not defined. > > > The js code is filled with references to the document object. Is > there a way to create it the way a web client would create it? A document object should be provided by EcmaScript embeddings, if you have a DOM implementation available, you can expose an object implementing org.w3c.dom.html.HTMLDocument to script as document. HTMLDocument interface gives a useful start of what should present in document, but to cover all the cases it would be necessary to implement all properties from http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_document.asp > > another problem I face is: How to provide the interperter with two or > three libraries of js functions in order to excecute a piece of code > with references to those functions? See http://mozilla.org/rhino/doc.html and in particular http://mozilla.org/rhino/tutorial.html Regards, Igor .