Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > BOOK: Beginning JavaScript
|
BOOK: Beginning JavaScript
This is the forum to discuss the Wrox book Beginning JavaScript by Paul Wilton; ISBN: 9780764544057
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 10th, 2003, 09:38 AM
Registered User
 
Join Date: Sep 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Javascript "alert()" acts modeless, p14

Using the following Javascript code (on Linux) produces different results depending on the browser. This code is closely related to that on page 14 of "Beginning Javascript" by Paul Wilton.

<HTML>
<HEAD> </HEAD>

<BODY BGCOLOR="GREEN">

    <P>Paragraph 1</P>

    <SCRIPT LANGUAGE="JavaScript">
        alert ("First Script Block");
        document.bgColor="BLUE";
    </SCRIPT>

    <P>Paragraph 2</P>

    <SCRIPT LANGUAGE="JavaScript">
        alert ("Second Script Block");
        document.bgColor="RED";
    </SCRIPT>

    <P>Paragraph 3</P>

</BODY>

</HTML>

-----------------------------------------------
When using Netscape (Linux), it does not halt at the "alert()" as it should (alert() should invoke a MODAL message box), but instead rushes along until it completes all the Javascript code, leaving all of the messageboxes on the screen, waiting for dismissal.

When using Konqueror, it halts correctly at the "alert()", but never changes colors, staying the original GREEN.
-----------------------------------------------------------

If I change from "alert()" to "confirm()", the Netscape run works, but I want an "alert()", not a "confirm()",because this is a different user interface. The Konqueror version using "confirm()" still fails to change colors.

I would certainly appreciate some help if anyone is familiar with this. Thanks!





Similar Threads
Thread Thread Starter Forum Replies Last Post
change text colors in an javascript Alert? larry Javascript How-To 5 February 12th, 2007 08:03 AM
PURE asp upload problem ., alert from Javascript kasanar ASP.NET 1.0 and 1.1 Professional 0 February 19th, 2005 10:06 AM
Javascript alert error Ed7777 Javascript How-To 5 June 25th, 2004 02:23 PM
Javascript alert box Adam H-W Javascript How-To 13 March 4th, 2004 05:11 AM
Javascript "alert()" acts modeless cppman Javascript 2 September 16th, 2003 09:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.