ESV Popup Javascript
About
ESV Popup is a Javascript you can use on your website that creates a small popup frame to display Bible verses from the English Standard Version Bible, using Javascript Syndication provided by the nice guys from Good News Publisher/Crossway Bibles.
Download
You will need both the following files:
- Download: esvpopup.js and esvpopup.html (5.0kb and 1.4kb 2008-04-01), or
- Download: esvpopup-1.4.zip (2.7kb 2008-04-01)
Example
Click on the following references to display Bible verses:
John 3:16-17, The Beatitudes, The Golden Chain, Tower of Babel, Jeremiah 31:31
You can also check out Scripturizer for Javascript’s testing page, and change “Bible Translation” to “English Standard Version (pop-up)”.
Usage
Follow these steps to use this script.
-
Download both “
esvpopup.js” and “esvpopup.html” to somewhere inside your web folder. Put both of them inside the same folder. -
Add the following Javascript tag in your main web page.
<script type="text/javascript" src="[path to]/esvpopup.js"></script>
-
In the places where you want Bible references, use the following HTML tags:
<a href="#" onclick="ESVPopup.onclick(event);return false;"> [Bible Reference] </a>
For example,
<a href="#" onclick="ESVPopup.onclick(event);return false;"> John 3:16-17 </a>
renders…
Or if you want to point to Bible verses from an arbitrary text,
<a href="#" onclick="ESVPopup.onclick(event, '[Bible Reference]');return false;"> [Arbitrary Text] </a>
For example,
<a href="#" onclick="ESVPopup.onclick(event, 'Matthew 5:3-12');return false;"> Beatitudes </a>
renders…
If you use it together with Scripturizer for Javascript, finding Bible passage references and creating links for pop-up will be done automatically. Just import both “scripturizer.js” and “esvpopup.js” inside your HTML!
Compatibility
This script has been tested under these browsers:
- Internet Explorer 6 SP1 and 7 on Windows XP SP2
- Firefox 1.5 on Windows/Mac OS X
- Firefox 2 on Windows
- Opera 9 on Windows
- Safari 3.0.x on Windows
Note — if you are using Opera, please change your user agent to “Opera” for it to work properly.
Support
Feel free to contact me if you have any question regarding to this script.
License
Consider this script as public domain, there is no license. Use it as much as you like on your website, but do beware of ESV’s web service conditions.
History
- 1.4 - 2008-04-01
- Fix extracting text content from selected element in Firefox 2.
- Fix iframe positioning issue in Safari 3.x
- 1.3 - 2007-06-07
- Fixed long passage scrolling issue in IE7.
- 1.2 - 2006-11-13
- Fixed border issue under Internet Explorer 7
- Generate dynamic URL to avoid caching on IE6/IE7.
- 1.1 - 2005-10-06
- Make it compatible with the latest version of Scripturizer for Javascript.
- Tested under Opera 8 and Safari 1.2.x.
- Use CSS filter to create shadow under IFrame in Internet Explorer.
- 1.0 - 2005-05-05
- Initial implementation.
