I want to make a web application that can do sentence diagramming (like we did in grade school), on a website that a user is viewing.
My server has a “dictionary” database that basically maps common words in English to their part of speech (noun, verb, adjective, etc). I’d like for a user of my site to be able to go to any site with text content, say a news blog, highlight a sentence on the page, and then right click or something to activate a javascript program, which will communicate with my site via HTTP POST (or better yet, AJAX), and send back a diagrammed sentence of the selection (or, a minimum equivalent, just a list identifying the part of speech of each word).
As far as I can tell, the big hurdle is: I need to run my javascript programs on other websites. Which is not possible of course. I thought about using iframes to do this, but if the src is from a different domain, you can’t access or manipulate the child window’s innerHTML, so that approach won’t work.
I was thinking I may be able to build a “browser within a browser” using Javascript. When a user comes to my site, clicks on “mini-browser”, it will download javascript to the client which will basically act as a proxy browser. The user would be able to type in a URL or follow a link just as they would on Firefox or Explorer, except within this browser, my own Javascript/AJAX functions will be available that will let me add tags to the content of the web page being viewed, and POST to my server the information necessary to do the sentence diagramming.
Is this a feasible approach? I have not been able to find anything like it, but I’m not really sure what it would be called so maybe I’m not doing the right searches. Anyways, I’m just curious how difficult this would be to implement, and what potential security or legal issues there could be.
I tried to keep this brief, but if something isn’t clear I can add more detail.
Thanks!
Helo