I want to insert a html code portion of an external web site of our company that relates to current news concerning the company (The database is unreachable).
I can’t figure out how to do that:
I’m a newbie in AJAX: Can AJAX do that ? Is XMLHTTPRequest capable of locating code between identified DIV tags in a HTML page ?
Can it be done by the server on a regular basis without a browser acting like a trigger (domino agent maybe…) so i could store the HTML snippet in a document ?
Is the server capable of instantiating a XMLHTTRequest object ?
Can it be achieved with XPage and SSJS ?
it’s a bit messy for me: am I missing something very simple ?
You can easily read from a remote URL using SSJS, using the java URL classes.
The syntax is slightly different than with Java, but its not hard to figure out.
If you use Ajax, you will run into cross-domain restrictions, a javascript in one domain is not allowed to access data in another for security reasons, however if you look around the net, you will probably find examples on how to avoid it.
I finally achieved it with the Jericho HTML Parser available on SourceForge, and a java agent i wrote. It works well.I tested numerous parser and Jericho is really a great framework.