Scripts

 

Resource Panel

The Script Resource Panel lets you create JavaScript code that enhances your webpage. The Scripts resource panel gives you the power of incorporating and editing events and actions to objects on your webpages through the use of pre-configured JavaScript functions (ScriptBits).

For example, clicking on a link is an "event" that triggers the "action" of telling the browser to load a new page.

Using the Scripts resource panel, you can now specify these kind of event-action rules to any other objects on your own webpages. Just select the object you wish to add an event-action rule to and away you go!

Tutorial

The tutorial below shows you how to create a simple message window.

Step 1. Creating a Link.

  1. In HotDog, close all the open documents. To do this from the Window menu, select Close All.

  2. Now create a new document by doing one of the following:

  1. Add the following anchor (link) to your document, between the <BODY> tags:

<A HREF="http://www.sausagetools.com">Jump to Sausage</A>

  1. From the File menu, select Save As...

  2. In the Save As dialog, use the Save in: drop-down list to navigate to the Sausage\HotDog6\HTMLFiles directory.

  3. In the File name field enter the name ScriptsDemo for your new HTML document.

  4. Click Save.

Step 2. Opening the Scripts Resource Window.

  1. From the View menu, select the Resource Manager submenu.

  2. From the Resource Manager submenu, click Scripts.

Step 3. Adding an Event.

  1. In your ScriptsDemo document, place your cursor within the opening anchor tag:

<A HREF="http://www.sausagetools.com">

  1. In the Scripts Resource Panel, click to add a new script.

  2. In the Create a new ScriptBit dialog, type the name myscript for your new script.

  3. Next to the Event field, click , select Mouse and then select Clicked.

  4. Next to the Object field, click and select Add Object ID.

  5. In the Add Object ID window, double-click on the opening anchor tag:

    <A HREF="http://www.sausagetools.com">

  6. Enter the ID name LINKID for your anchor tag.

  7. Click OK.

  8. Click Close.

  9. Next to the Action field, click , select Dialog and then select Alert.

  10. In the Parameters panel, next to Message, type Linking to Sausage Software.

  11. Click OK.

Step 4. Previewing your Webpage.