SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Dec 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    simply javascript book

    hello ,here is a simple piece of code from simply js book the problem is this piece of code does not work , it should return an alert.


    Code JavaScript:
    var Robot =
    {
    metal: "Titanium",
     killAllHumans: function()
    {
    alert("Exterminate!");
     }
    };
    Last edited by Tetrix03; Dec 30, 2007 at 11:32.

  2. #2
    SitePoint Addict
    Join Date
    Dec 2007
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How are you executing the function?

    It should be Robot.killAllHumans()

  3. #3
    SitePoint Member
    Join Date
    Dec 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you now it works

  4. #4
    SitePoint Zealot
    Join Date
    Dec 2007
    Posts
    120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    By the way, if you're looking for Javascript books, I highly recommend the following:

    Javascript: The Definitive Guide, David Flanagan
    Professional Javascript for Web Developers, Nicholas Zakas


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •