Disclaimer: please excuse the religious aspects of this post.
Anyway, the title says what I'm looking for essentially. I'm writing a program to find Bible references on a page, then display the actual verse in a tooltip upon mouseover of the reference.
I'm hoping to get permission from this site eventually. Now, I've done research and I learned about the "Same Origin Policy"; but as far as I can tell this doesn't really apply because I'm not trying to call functions/methods from JavaScript on that site.
All I want to do is grab a verse off of the page. I thought this site would be convenient because it will mark individual verses with the correct url like so: http://www.drbo.org/x/d?b=drb&bk=47&ch=16&l=18. I've tried loading this up in an iframe but I couldn't for the life of me get hold of the the <span> element with class='highlight' which is, by chance, the only span on the page.
The attempt I just made today was to use JSONP in the form of:
function crossedFingers(variable) {
alert(variable);
}
var scr = document.createElement('script');
scr.setAttribute('type', 'text/javascript');
scr.setAttribute('charset', 'utf-8');
scr.setAttribute('src', 'http://www.drbo.org/x/d?b=drb&bk=47&ch=16&l=18&callback=crossedFingers');
document.getElementsByTagName('head').item(0).appendChild(scr);
I also had a version where I had
function crossedFingers() {
alert('hi');
}
just to see if the function actually got called and it didn't. I'm using WAMP and I have these files in the www directory, but I'm not sure that should effect it. Any help would be appreciated, sorry if this in an inappropriate question!
I've just been frustrated. @_@