HTMLObject::Normal(3)

NAME
HTMLObject::Normal - Perl extension for HTMLObject.

SYNOPSIS
  use HTMLObject::Normal;
  my $doc = HTMLObject::Normal->new();

  $doc->setTitle("Test of HTMLObject::Normal");
  $doc->setFocus("body");
  $doc->print(<<"END_OF_BODY");
  <center>
  <h1>HTMLObject::Normal</h1>
  <br>
  This is cool!
  END_OF_BODY

  $doc->setCookie(name => 'cookie name', value => 'This rocks!');

  $doc->setFocus("javascript");
  $doc->print(<<"END_OF_JAVASCRIPT");
    function helloWorld()
    {
      document.write("Hello World");
    }
  END_OF_JAVASCRIPT  # This must be left aligned all the way.

  # cause the helloWorld function to be called when the page has been
  # loaded!
  $doc->setOnload(code => "helloWorld();");

  # Actually generate the entire document, cookie and all!
  $doc->display();

DESCRIPTION
HTMLObject::Normal builds on the HTMLObject::Base object and provides JavaScript support that facilitates making Dynamic HTML documents much easier than before. See the documentation.html file for more details.

Exported FUNCTIONS
  scalar new()
    Creates a new instance of the HTMLObject::Normal document type.

  void reset()
    Resets the HTMLObject::Normal document back to the defaults.

  void display()
    This function generates the Normal Document displaying any cookies,
    JavaScript, Base, Links, etc. that were specified by the user plus
    the contents of the Body that the user created.  This function prints
    the generated document to standard out which is then hopefully being
    sent to a web server to process.

  void displayError(title => '', message => '')
    Creates a HTML document that displays the user specified error
    message along with the error message generated by the program. The
    user specified title is used also. The program is exited after the
    document is displayed. Uses display() to generate the actual document.

  void set_focus(section) (scalar value)
    Validates the section name specified and then sets the internal
    pointer to the specified section. The output of any following print,
    read, or delete commands will work with the specified section.
    Modifies $currentSection.  This version handles "javascript" and
    passes everything else to the HTMLObject::Base class to handle.

  void setFocus(section) (scalar value)
    Validates the section name specified and then sets the internal
    pointer to the specified section. The output of any following print,
    read, or delete commands will work with the specified section.
    Modifies $currentSection.  This version handles "javascript" and
    passes everything else to the HTMLObject::Base class to handle.

  void print(string) (scalar value)
    Appends the contents of string to the currently specified section.
    This could modify $headString, $bodyString, $javascriptBody.

  scalar read()
    Returns the contents of the currently specified section. This could
    be $headString, $bodyString, $javascriptBody.

  void delete()
    Deletes the contents of the currently specified section. You should
    call read() before doing this so you can restore if this was an
    accident. This could modify $headString, $bodyString,
    $javascriptBody.

  void set_javascript_include(version => '', file => '')
    This function creates an entry in the @javascriptIncludes array that
    will create the code to include the specified javascript file and run
    it at the specified language version. If the version is not
    specified, then "JavaScript" is the default language and version.
    Modifies @javascriptIncludes.

  void setJavascriptInclude(version => '', file => '')
    This function creates an entry in the @javascriptIncludes array that
    will create the code to include the specified javascript file and run
    it at the specified language version. If the version is not
    specified, then "JavaScript" is the default language and version.
    Modifies @javascriptIncludes.

  void set_javascript_version(version) (scalar value)
    This function sets what the Javascript version should be for the
    JavaScript body section. If not specified before the user calls
    display(), then the version will be JavaScript1.1. Modifies
    $javascriptVersion.

  void setJavascriptVersion(version) (scalar value)
    This function sets what the Javascript version should be for the
    JavaScript body section. If not specified before the user calls
    display(), then the version will be JavaScript1.1. Modifies
    $javascriptVersion.

  scalar get_javascript_version()
    This function returns the current JavaScript version that is set in
    javascriptVersion.

  scalar getJavascriptVersion()
    This function returns the current JavaScript version that is set in
    javascriptVersion.

  void print_javascript_required(version => '', message => '')
    This function will create the <noscript>$message</noscript> tags in
    the head that will be run if the browser does not support scripting
    at all and will also generate the code to display the message if the
    specified version of scripting is not supported. Modifies
    $javascriptRequiredMessage, $javascriptRequiredVersion.

  void printJavascriptRequired(version => '', message => '')
    This function will create the <noscript>$message</noscript> tags in
    the head that will be run if the browser does not support scripting
    at all and will also generate the code to display the message if the
    specified version of scripting is not supported. Modifies
    $javascriptRequiredMessage, $javascriptRequiredVersion.

  void disable_javascript_error_handler()
    This function sets the variable $javascriptErrorHandler to 0 so
    that I know not to generate that block of code when displaying the
    document.

  void disableJavascriptErrorHandler()
    This function sets the variable $javascriptErrorHandler to 0 so
    that I know not to generate that block of code when displaying the
    document.

  scalar is_javascript_error_handler_enabled()
    This function returns the value of the javascriptErrorHandler to
    see if it is enabled or disabled.

  scalar isJavascriptErrorHandlerEnabled()
    This function returns the value of the javascriptErrorHandler to
    see if it is enabled or disabled.

  void set_javascript_error_handler_email(email => '')
    This function will set the value of $javascriptErrorHandlerEmail
    to the value specified.  This is used in the generic JavaScript error
    handler.

  void setJavascriptErrorHandlerEmail(email => '')
    This function will set the value of $javascriptErrorHandlerEmail
    to the value specified.  This is used in the generic JavaScript error
    handler.

  scalar get_javascript_error_handler_email()
    This function returns the email address that will be used by the
    builtin error handling code.

  scalar getJavascriptErrorHandlerEmail()
    This function returns the email address that will be used by the
    builtin error handling code.

  void set_javascript_error_handler(code => '')
    This function will set the code to use for the JavaScript error
    handler and will assign it to $javascriptErrorHandlerCode.  It is
    up to the user to properly set the return value so that JavaScript
    does not continue to process the error message.  The user must also
    create their own JavaScript window, etc.

  void setJavascriptErrorHandler(code => '')
    This function will set the code to use for the JavaScript error
    handler and will assign it to $javascriptErrorHandlerCode.  It is
    up to the user to properly set the return value so that JavaScript
    does not continue to process the error message.  The user must also
    create their own JavaScript window, etc.

  void set_javascript_error_handler_window(name => '')
    This function will set the base window name to prepend to the
    window creation code used by the builtin error handler.

  void setJavascriptErrorHandlerWindow(name => '')
    This function will set the base window name to prepend to the
    window creation code used by the builtin error handler.

  scalar get_javascript_error_handler_window()
    This function returns the window name that will be used by the
    builtin error handler.

  scalar getJavascriptErrorHandlerWindow()
    This function returns the window name that will be used by the
    builtin error handler.

  void set_onload(parameters => '', options => '', code => '')
    This function stores the parameters needed by the code, the options
    to pass into the function and the code to be run and then generates
    the doOnLoad JavaScript function in the JavaScript block of code when
    the user calls display(). The onLoad="doOnLoad($options);" code is
    added to the <body> tag when the page is displayed. Modifies
    $javascriptOnloadParameters, $javascriptOnloadOptions,
    $javascriptOnload.

  void setOnload(parameters => '', options => '', code => '')
    This function stores the parameters needed by the code, the options
    to pass into the function and the code to be run and then generates
    the doOnLoad JavaScript function in the JavaScript block of code when
    the user calls display(). The onLoad="doOnLoad($options);" code is
    added to the <body> tag when the page is displayed. Modifies
    $javascriptOnloadParameters, $javascriptOnloadOptions,
    $javascriptOnload.

  void set_onunload(parameters => '', options => '', code => '')
    This function stores the parameters needed by the code, the options
    to pass into the function and the code to be run and then generates
    the doOnUnLoad JavaScript function in the JavaScript block of code
    when the user calls display(). The onUnLoad="doOnUnLoad($options);"
    code is added to the <body> tag when the page is displayed. Modifies
    $javascriptOnunloadParameters, $javascriptOnunloadOptions,
    $javascriptOnunload.

  void setOnunload(parameters => '', options => '', code => '')
    This function stores the parameters needed by the code, the options
    to pass into the function and the code to be run and then generates
    the doOnUnLoad JavaScript function in the JavaScript block of code
    when the user calls display(). The onUnLoad="doOnUnLoad($options);"
    code is added to the <body> tag when the page is displayed. Modifies
    $javascriptOnunloadParameters, $javascriptOnunloadOptions,
    $javascriptOnunload.

  void set_base(href => '', target => '')
    This function allows the user to specify the base url of the webpage
    or more importantly the default target that all links should point to
    if not explicitly specified. This is mainly used in web pages that
    are in a frameset. Modifies $baseHrefString, $baseTargetString.

  void setBase(href => '', target => '')
    This function allows the user to specify the base url of the webpage
    or more importantly the default target that all links should point to
    if not explicitly specified. This is mainly used in web pages that
    are in a frameset. Modifies $baseHrefString, $baseTargetString.

  void set_link(href => '', name => '', rel => '', rev => '',
                target => '', title => '')
    This function allows the user to specify a <link> tag item that is
    stored in the @linkTag array to be displayed in the <head> when the
    document is created. Modifies @linkTag.

  void setLink(href => '', name => '', rel => '', rev => '',
               target => '', title => '')
    This function allows the user to specify a <link> tag item that is
    stored in the @linkTag array to be displayed in the <head> when the
    document is created. Modifies @linkTag.

  void set_link_decorations(link => 'none', alink => 'none',
                            vlink => 'none', hover => '')
    This function allows the user to specify the decorations that the link,
    visited link, active link and hover link have.  If you specify nothing,
    then by default it turns off all decorations (no underline).  This
    generates a CSS section to specify the link decorations you desire.

  void setLinkDecorations(link => 'none', alink => 'none',
                          vlink => 'none', hover => '')
    This function allows the user to specify the decorations that the link,
    visited link, active link and hover link have.  If you specify nothing,
    then by default it turns off all decorations (no underline).  This
    generates a CSS section to specify the link decorations you desire.

AUTHOR
James A. Pattie, htmlobject@pcxperience.com

SEE ALSO
perl(1), HTMLObject::Base(3), HTMLObject::FrameSet(3), HTMLObject::ReadCookie(3).