WebReference.com logo
tip archive  •   about  •   sitemap  •   contact  •   jobs  •   write for us  •   subscribe

Cross-Reference (xref) Script Maker

By Dan Ragle

Social Bookmark

Sr. Web Developer
mediabistro.com
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume


You may also enjoy:

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.

Script Controls








Term Entry


Term List
Results

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).

User Comments Submit | Register | Login Comment Feed RSS 2.0
No comments have been posted for this article yet.
   

Please review our Comment Submission Policy before submitting comments to our site.
Your name:
 Your E-mail:
* Your URL:
* Your Subject:
(Maximum characters allowed: 200)
Your comment:
(Maximum characters allowed: 5000)
CAPTCHA Verification
Please enter the code displayed to the right in the box below:
CAPTCHA Image
Hear it!
  

* = optional field

Recent Articles

WebReference.com site name
Rolling Out Your Own HTML Application Version Control
HTML 5: Client-side Storage
Working with Ajax Server Extensions
internet.com site name
Wi-Fi Product Watch, November 2009
Chip Market Recovering From '08 Collapse
Low-Cost Tools to Kickstart Your New Business


internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs