SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    ********* Articles ArticleBot's Avatar
    Join Date
    Apr 2001
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Article Discussion

    This is an article discussion thread for discussing the SitePoint article, "Script Smarter: Quality JavaScript from Scratch"

  2. #2
    SitePoint Enthusiast newsomer's Avatar
    Join Date
    Oct 2001
    Location
    Southwestern Georgia, USA
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am still going through what appears to be an outstanding article but it starts off with one glaring mistake. ASP (Active Server Pages) is not a language like PHP, it is an application environment.

    I am sure there are some that would call this a technicality but I think the distinction is important.

    It's ironic that JScript (a very close relative to JavaScript) can be used as one of the scripting languages in ASP.

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    Latinoamérica
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Excellent.

    I just don't know what I'm going to do in order to learn all the interesting things I find here all the time. Maybe set an additional day for doing Sitepoint tutorials? Hire someone to explain them for me in 20 minutes?

    btw I absolutely love the little cartoons that come up with every major article.

    This sure is the best site in the whole Internet.

  4. #4
    SitePoint Guru Galo's Avatar
    Join Date
    May 2005
    Location
    Holland!
    Posts
    852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    application environment = API no...

    Great article, but where is that chapter about XMLHttpRequest ?

  5. #5
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Edit:

    WARNING!!! I made the setting change to strict-->true that's outlined in the article(quoted below), and now I can't get FF1.0.7 to launch properly. It comes up blank(no home page), and none of the browser controls work, so it's completely useless.


    How about this example:
    Strict Warnings

    If you open the JavaScript console in Firefox you'll see that it includes options to show Errors and Warnings. Warnings notify you of code that, though it is not erroneous per se, does rely on automatic error handling, uses deprecated syntax, or is in some other way untrue to the ECMAScript specification. (To see these warnings, it may be necessary to enable strict reporting by typing in the address about:config and setting javascript.options.strict to true.)

    For example, the variable fruit is defined twice in the code below:

    Example 1.17. strict-warnings.js (excerpt)
    Code:
    var fruit = 'mango';
    
    if (basket.indexOf('apple') != -1)
    {
        var fruit = 'apple';
    }
    There is a bigger problem with that code than 'fruit' being declared twice, and the FF Javascript console doesn't need to be set to strict to find it.

  6. #6
    SitePoint Guru
    Join Date
    Mar 2004
    Location
    Earth
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by 7stud
    WARNING!!! I made the setting change to strict-->true that's outlined in the article(quoted below), and now I can't get FF1.0.7 to launch properly. It comes up blank(no home page), and none of the browser controls work, so it's completely useless.
    Sorry man, I've never seen that happen before .. it's always been okay for me.

    Quote Originally Posted by 7stud
    There is a bigger problem with that code than 'fruit' being declared twice, and the FF Javascript console doesn't need to be set to strict to find it.
    Go on ...

  7. #7
    SitePoint Evangelist artcoder's Avatar
    Join Date
    Aug 2005
    Location
    Planet Earth
    Posts
    598
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great tutorial. I like the fact that it is very comprehensive with lots advanced solutions to practical problems.

  8. #8
    yussless
    SitePoint Community Guest
    The last sub section - Sorting Tables by Column - doesn't work with the example code! Are bits missing, which are in the full book??

  9. #9
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok. I think this is copied directly from the first edition, which I think needs to be corrected

    function changeBorder(element, to)
    {
    element.style.borderColor = to;
    }

    var contentDiv = document.getElementById('content');

    contentDiv.onmouseover = function()
    {
    changeBorder('red');
    };

    contentDiv.onmouseout = function()
    {
    changeBorder('black');
    };
    The custom changeBorder function accepts two parameters, yet in the article and book its only being fed ONE. aren't you supposed to feed 'this' as the first parameter?

    JS Console:

    >>> document.body.style.border = '9px solid pink';
    "9px solid pink"
    >>> function changeBorder(el, to) { el.style.borderColor = to; }
    >>> document.body.onmouseover = function() { changeBorder('red'); }
    function()

    when hovering over : to has no properties

    >>> document.body.onmouseover = function() { changeBorder(this, 'red'); }
    when hovering over : the border becomes red.


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
  •