Results 1 to 2 of 2

Thread: Javascript with HTML

  1. #1
    Join Date
    Sep 2009
    Location
    Salt Lake City, UT
    Posts
    2

    Javascript with HTML

    I am not sure why I am getting this error.
    Code:
    courses.append("<table border=\"3\" id=\"courses\" cellpadding=\"5\" cellspacing=\"5\">" +
    			   "<tr><th width=\"255\">Course</th><th width=\"255\">" +
                              "Authors</th><th width=\"275\">Tags</th></tr>");
    The error I am getting says that the first attribute of the table which is border must have a value in
    double quotes. I thought the \"3\" produced the double quotes, since \"3\" is surrounded by double quotes.
    Any advise? I am stuck! This is my first post.

  2. #2
    Join Date
    Apr 2009
    Location
    The toon
    Posts
    1,225
    try this

    Code:
    courses.append('<table border="3" id="courses" cellpadding="5" cellspacing="5">' +
    			   '<tr><th width="255">Course</th><th width="255">' +
                              'Authors</th><th width="275">Tags</th></tr>');
    i have removed the escape slashes and replaced the top level double quotes with single quotes here...

Posting Permissions

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