p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   BOOK: ASP.NET 4 24-Hour Trainer (http://p2p.wrox.com/book-asp-net-4-24-hour-trainer-591/)
-   -   Chapter 1 javascript won't work (http://p2p.wrox.com/book-asp-net-4-24-hour-trainer/80794-chapter-1-javascript-wont-work.html)

Bob Sulewski September 2nd, 2010 07:32 PM

Chapter 1 javascript won't work
 
I entered the code exactly as in the book and on the dvd but when I press the SelectColor button, I get no result. What gives?[:confused:]

Toi B Wright September 3rd, 2010 10:48 AM

Have you downloaded the solution file for that lesson? - http://www.wrox.com/WileyCDA/WroxTit...-DOWNLOAD.html

I hope this helps.

Regards,


Toi B Wright

Bob Sulewski September 4th, 2010 10:03 AM

Don't work in Firefox
 
I got it working in IE but it still don't work in firefox. [:confused:]

7hamlet September 18th, 2010 12:28 AM

。。[:p]louzhujiayou

GBPhilip January 17th, 2011 12:55 PM

I have the same problem - what is the workaround? If with a simple program there are browser problems what chances of getting something more complex to work

Toi B Wright January 17th, 2011 03:54 PM

Chapter 1 for FireFox
 
This is the corrected code that will work on all of the non-Microsoft browsers:

Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Hello World</title>
    <style type="text/css">
        h1
        {
            color: Blue;
        }
    </style>
    <script type="text/javascript">
        function ShowSelection() {
            alert('You have selected ' + document.getElementById("SelectColor").value);
            document.getElementById("BodyContent").style.backgroundColor = document.getElementById("SelectColor").value;
        }
    </script>
</head>
<body>
    <div id="BodyContent">
        <h1>
            Hello World</h1>
        <h2>
            Welcome</h2>
        This is my first web page.
        <hr />
        Please select a color:
        <select id="SelectColor">
            <option value="white">white</option>
            <option value="silver">silver</option>
            <option value="yellow">yellow</option>
        </select>
        <input id="ButtonSelect" type="button" value="Select" onclick="ShowSelection();" />
    </div>
</body>
</html>


Sirajee January 31st, 2012 08:18 AM

Best way to books shopping deals
 
The Nook Color Tablet from Barnes and Noble is one such e-reader that was one of the first in bringing technology to the world of books. This device has many features that make it a great buy, at a very competitive price.

http://shoppingfordealsonline.com/books/


All times are GMT -4. The time now is 02:45 PM.

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