PDA

View Full Version : Javascript with HTML



trixt.er
16 Sep 2009, 11:50 AM
I am not sure why I am getting this error.


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.

is_numeric
16 Sep 2009, 01:13 PM
try this


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...