Evaluating Scripts

Shadi Abou-Zahra, W3C/WAI
Sophia-Antipolis, France
shadi@w3.org

Script Fallback

Beware: some tools are satisfied with empty NOSCRIPT elements

Script Equivalent

  ...
  <noscript>
    <p>YOUR BROWSER DOES NOT SUPPORT JAVASCRIPT!!!</p>
  </noscript>
  ...

Example: Script Fallback 1

Before

<script language="JavaScript" type="text/javascript">
  document.write('<table width="' + myWidth '">');
  ...

After

<table id="fluid" width="100%">
<script language="JavaScript" type="text/javascript">
  document.fluid.width = myWidth;
  ...

Example: Script Fallback 2

Before

<a href="javascript:function()">Link Text</a>

After

<a href="redundant.html" onClick="function()"...

Script Fallback: Approach

Obsolete Scripts

Frequently applicable to decoration scripts such as rollover effect

Example: Rollover Script

Before

  <a href="page.html" onMouseOut="out(1)"
                       onMouseOver="over(1)" ...>Link Text</a>

After

  <style type="text/css">
    a:hover { ... }
  </style>
  ...
  <a href="page.html" ...>Link Text</a>

Event Handlers

Special case: applets and embedded objects with own user interface

Embedded Objects

Problem: difficult to evaluate third-party plugin software

Event Handlers: Approach

Other Checkpoints