SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member randie's Avatar
    Join Date
    Oct 2008
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    >>> invalid html, id="imagePlaceHolder" not unique

    In Chapter 4 of Jump Start Node.js, after adding these 2 gists to chapter4/views/index.ejs:

    you end up with 2 id's named "imagePlaceHolder" in a single html page, one for each of the modals. To be a valid html page, id's must be unique within a page. So our chapter4/views/index.ejs produces an invalid html page.

    Was this intentional, or is this a mistake?

  2. #2
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,617
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    It look like the examples were intended to be worked with separately. If you wish to combine them on the same HTML page, you will have to make the necessary adjustments so that there are no duplicate IDs.
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  3. #3
    SitePoint Member randie's Avatar
    Join Date
    Oct 2008
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Force Flow View Post
    It look like the examples were intended to be worked with separately. If you wish to combine them on the same HTML page, you will have to make the necessary adjustments so that there are no duplicate IDs.
    Have you actually worked through the examples? Because if you have, you would know that while you work on each modal separately, the end result is a single index.ejs file that will render a single html file containing both modals, one for signup and one for login.

    If you take a look at the book's source code (download from http://www.sitepoint.com/books/nodejs1/code.php), you'll see that there are 2 modals in a single index.ejs file and there are 2 id's with the same value (imagePlaceHolder, one on line 25 and the other on line 48), which is not valid html.

    If the book's source code produces invalid html, that seems like a mistake to me. If so, then the source code needs to be modified, and so does any styling or behavior that targets that id.

  4. #4
    SitePoint Member randie's Avatar
    Join Date
    Oct 2008
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,338
    Mentioned
    465 Post(s)
    Tagged
    8 Thread(s)
    On the surface of it, it does look like this is an oversight, but let's see what @Don Nguyen has to say. (He's the author.)

  6. #6
    SitePoint Author
    Join Date
    Nov 2012
    Posts
    48
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    It's a mistake I will see if SitePoint can correct


Tags for this Thread

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
  •