DDS JavaScript Search Examples
These examples show how to use the JavaScript Search Service to create a custom search interface and display ADN resources in an HTML page.
Each example page highlights one or more of the possible functionalities of the service and can be used as a template to begin your own web page.
- Full Example - Contains examples of all the possible functionalities that are available from the service and
includes code for each of the possible service commands. Commands that are not displayed are commented
out in the code and can be un-commented as desired to display them and vice versa.
- Example 1 - Illustrates a page that has standard menus to select grade levels, resources types and subjects.
- Example 2 - Illustrates using a drop list to display resources by topics that you define.
- Example 3 - Illustrates using 'SmartLinks' to display resources by topics that you define, and custom menus that include topics that you define.
- Example 4 - Illustrates a non-interactive page that displays the library resources that you choose.
- Example 5 - Illustrates performing a search in one page that redirects to another page.
This example uses graphics and colors to display a more typical page design in an applied setting.
How to use these examples
To create a custom search web page, browse through the examples
to find one that best matches the design and behavior you would like to use
in your page. Once you've found an example that you like, do one of the following:
- Option one: Save the example page to your computer and edit it. To to this, first pull up the example in your browser and then choose 'File > Save As' from the browser 's menu and save the file as a single web page, HTML only. Alternatively, you may download all the examples from the download area on SourceForge to your computer as a package. After downloading, unpack the ZIP file to access the examples inside. Once you've got the HTML file saved on your computer, simply edit as desired.
- Option two: View the source code for the example page and then copy and paste it into an existing page your already have. To do this, first pull up the example in your browser and then choose the 'View > Source' command in your web browser. This will display the source code for the example. Then copy and paste the JavaScript and/or CSS portions of the code into your existing page. All of the <SCRIPT> code is required; the CSS <LINK> reference is recommended but optional.
After you are done developing your page, simply deploy the page to your web site as you would any other HTML page. There are no special requirements needed to install or deploy a JavaScript Search page to your
web site.
Resources and additional documentation:
- The Service documentation contains detailed information about how to use the service including descriptions of each of the commands that are available from the service to control the features and behavior of your search page.
- See the tips for developers section of the documentation, which has detailed information about developing pages using the service.