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).
"Objects" on your webpage are such things as blocks of text, images, links, etc.
An "event" is something that occurs when someone viewing your webpage does something to the object.
An action is what occurs when the event has taken place.
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!
The tutorial below shows you how to create a simple message window.
In HotDog, close all the open documents. To do this from the Window menu, select Close All.
Now create a new document by doing one of the following:
Pressing <CTRL> + <N>.
Click
on the File Toolbar.
Add the following anchor (link) to your document, between the <BODY> tags:
<A href="http://www.sausagetools.com">jump to Sausage</A>
From the File menu, select Save As...
In the Save As dialog, use the Save in: drop-down list to navigate to the Sausage\HotDog6\HTMLFiles directory.
In the File name field enter the name ScriptsDemo for your new HTML document.
Click Save.
From the View menu, select the Resource Manager submenu.
From the Resource Manager submenu, click Scripts.
In your ScriptsDemo document, place your cursor within the opening anchor tag:
<A href="http://www.sausagetools.com">
In the Scripts Resource Panel,
click
to add a new script.
In the Create a new ScriptBit dialog, type the name myscript for your new script.
Next to the Event field,
click
, select Mouse and then
select Clicked.
Next to the Object field,
click
and select Add Object ID.
In the Add Object ID window, double-click on the opening anchor tag:
<A href="http://www.sausagetools.com">
Enter the ID name LINKID for your anchor tag.
Click OK.
Click Close.
Next to the Action field,
click
, select Dialog and then
select Alert.
In the Parameters panel, next to Message, type Linking to Sausage Software.
Click OK.
Press F9 to preview your web page. When you click on the link, your message will appear.