Skip to Main Content
JavaScript Application Cookbook
book

JavaScript Application Cookbook

by Jerry Bradenbaugh
October 1999
Intermediate to advanced content levelIntermediate to advanced
480 pages
14h 47m
English
O'Reilly Media, Inc.
Content preview from JavaScript Application Cookbook

Building Your Own JavaScript Database

Eventually you’ll want to replace the records I’ve provided with your own records. You can do this in three easy steps.

  1. Open records.js in your text editor.

  2. Remove the records already there so that the file looks like this:

    var profiles = new Array(
            );
  3. For each record you want to add, use the following syntax:

    "Your_Page_Title|Your_Page_Description|http://your_page_url/file_name.html",

Add as many of these elements between the parentheses as you want. Be sure to include the comma at the end of each record—except the last one. Notice also the page title, description, and URL are each separated by | (the pipe character). Don’t use any of those in your titles, descriptions, or URLs. That will cause JavaScript errors. Remember, too that if you include double quotes (“) other than the ones on the outside, be sure to escape them with a backslash (e.g., use \” instead of just “).

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

JavaScript Application Design

JavaScript Application Design

Nicolas Bevacqua
JavaScript Cookbook

JavaScript Cookbook

Shelley Powers

Publisher Resources

ISBN: 1565925777Supplemental ContentOtherErrata Page