Cross-Reference (xref) Script Maker
By Dan Ragle
You can use this page to auto-generate a static, JavaScript-only cross-reference--or xref--script that you can use on your site, and you can invite your affiliate sites to include in their pages, as well. The WebRef xref script will search for the existence of key terms within any Web page it's included on, automatically generating links for those terms to URLs of your choosing. In addition to the static version of the xref script generated by the form below, WebRef also offers a more dynamic version of the script with a Perl back-end. Please visit this page for further information about xref.
To generate your own static xref script, fill in the required information in the form below and click Generate. The script will then be generated and presented in the Results box. Installation instructions for the resulting script are provided beneath the form.
Installation Instructions
Once you've generated the xref script via the form above, copy and paste it into a file on your Web server. For purposes of example, let's assume you create the file xref.js and put it in the /xref folder on your server. (But you can name it anything you want.)
Then, to implement the script on your site, just add this command to any page within which you want the terms automatically linked:
<script type="text/javascript" src="http://example.com/xref/xref.js">
</script>
Be sure to replace http://example.com with your actual domain name, and replace the path with the actual location you used, if other than xref/xref.js.
Note that if you selected the Scan Now option when you built the script,
then you should include the above command near the bottom of your pages; or at the very least
at a point after the text that you want automatically linked. Otherwise, the xref
script will not "see" the text that you want examined! In fact, I strongly recommend that
when using the Scan Now option, you place the script at the very end of your
Web pages,
just before the closing </body> tag. Internet Explorer 7,
in particular, is very sensitive to dynamically inserted
scripts when they occur between or within certain page
elements, and at times during our testing would even go
so far as to refuse to display the Web page at all! Placing
the script at the end of the page seemed to provide
consistently good (I.E., no crashes, no errors) behavior
from all browsers. And if you don't use Scan Now, the
script seems quite stable anywhere on the page, including within the
<head> of the document.
Your affiliates can also include the script in their own pages directly; they do not have to have their own local copy of the script (but you're free to provide it for them, if you prefer).




