Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > BOOK: JavaScript 24-Hour Trainer
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: JavaScript 24-Hour Trainer
This is the forum to discuss the Wrox book JavaScript 24-Hour Trainer Jeremy McPeak; ISBN: 978-0-470-64783-7
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: JavaScript 24-Hour Trainer section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 19th, 2013, 11:45 AM
Registered User
Points: 31, Level: 1
Points: 31, Level: 1 Points: 31, Level: 1 Points: 31, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2011
Posts: 7
Thanks: 3
Thanked 0 Times in 0 Posts
Default Lesson 21 - tagName & className

Having trouble with tagName & className because it is null and not an object per IE9 and not a function per Firebug on Firefox.

the Javascript code I have which I used for lesson are as follows:

Code:
function mouseHandler(event)
        {
            var eSrc = event.target;
            var type = event.type;

            if (eSrc.tagName.ToUpperCase() === "SPAN")
            {
                if (type === "mouseover")
                {
                    if (eSrc.className !== "button-click") 
                    {
                        eSrc.className = "button-over";
                    }
                }
                else if (type === "mouseout")
                {
                    if (eSrc.className !== "button-click") 
                    {
                        eSrc.className = "button-normal";
                    }
                }
                else if (type === "click")
                {
                    if (eSrc.className !== "button-click")
                    {
                        eSrc.className = "button-click";
                    }
                    else
                    {
                        eSrc.className = "button-over";
                    }

                }
            }
        }

        eventUtility.addEvent(document, "mouseover", mouseHandler);
        eventUtility.addEvent(document, "mouseout", mouseHandler);
        eventUtility.addEvent(document, "click", mouseHandler);
Appreciate your help Thanks!
Reply With Quote
  #2 (permalink)  
Old June 21st, 2013, 12:38 PM
jmcpeak's Avatar
Wrox Author
Points: 467, Level: 7
Points: 467, Level: 7 Points: 467, Level: 7 Points: 467, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2005
Location: , Texas, USA.
Posts: 87
Thanks: 0
Thanked 17 Times in 16 Posts
Default

Howdy mrubin78,

The code you provided uses ToUpperCase() instead of toUpperCase(). That should solve the problem for Firefox. As for IE9, make sure the browser is in IE9 standards mode.
Reply With Quote
The Following User Says Thank You to jmcpeak For This Useful Post:
mrubin78 (July 8th, 2013)
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lesson 21 Try It (Handling Errors) Mech_1000 BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer 3 February 21st, 2013 10:49 AM
Lesson 21 Confused econophil BOOK: JavaScript 24-Hour Trainer 1 January 7th, 2013 11:42 AM
Errors LESSON CS 28 & 29 FINAL MRGLENN BOOK: PHP and MySQL 24-Hour Trainer 2 December 7th, 2012 09:06 PM
Lesson 21 Try It Cristina BOOK: Java Programming 24-Hour Trainer by Yakov Fain 0 March 28th, 2012 03:58 AM
Chapters 20 & 21 as a starting point Lawrence Lovig BOOK: Beginning Unix ISBN: 0-7645-7994-0 2 October 10th, 2006 12:51 AM



All times are GMT -4. The time now is 12:42 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.