W3C home > Mailing lists > Public > w3c-wai-gl@w3.org > July to September 2005

Re: [TECHS] Sample Scripting Technique with Testing Procedures

From: Martin Honnen <Martin.Honnen@gmx.de>
Date: Thu, 11 Aug 2005 14:07:44 +0200
Message-ID: <42FB3F90.6070004@gmx.de>
To: WCAG <w3c-wai-gl@w3.org>



Becky_Gibson@notesdev.ibm.com wrote:

> I took an action item to propose a scripting technique and procedures for 
> testing it.   

> The idea is to show a technique to allow 
> the user to turn off non-essential interruptions such as those created via 
> the JavaScript alert() function.   

> <script type="text/javascript">
> var bDoAlerts = true;  // global variable which specifies whether to display alerts or not
> 
> /* function to disable alerts.  Called from onclick event on button element in the page */
> function disableAlerts() {
> 	bDoAlerts = false;
> 
> }
> 
> /* wrapper function for displaying alerts.  Checks the value of bDoAlerts
>  *and only calls the alert() function when bDoAlerts is true.
>  */
> function {
   ^^^^^^^^^^
This is not syntactically correct and gives a syntax error. You would 
need () after the function keyword but it rather looks as if all you 
want in the script is the following lines with the function declaration 
for doAlert

> function doAlert(aMessage) {
> 	if (bDoAlerts) {
> 		alert(aMessage);
> 	}
> }

and that "function {" needs to be removed.


-- 

	Martin Honnen
	http://JavaScript.FAQTs.com/
Received on Thursday, 11 August 2005 12:10:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:47:39 GMT