I made a simple bulletin board system with a PHP-based server-side program that generates JSON responses.
For the client's side I chose to dynamically generate all HTML codes using jQuery.
<body>
<ol class="list" id="viewList"></ol>
$(document).ready(function () {
$.getJSON("list.php", function (json) {
var nPosts = json.length;
for (i = 0; i < nPosts; i++) {
$('<ol/>', {
class: "viewPost",
id: "post" + i
}).appendTo("#viewList");
$('<li/>', {
class: "viewAuthor",
id: "author" + i,
text: json[i].authorName
}).appendTo("#post" + i);
$('<li/>', {
class: "viewEmail",
id: "email" + i,
text: json[i].authorEmail
}).appendTo("#post" + i);
}
});
//Problem HERE:
var post0 = document.getElementById("post0");
post0['style']['border-top-width'] = '0px';
});
What I'm doing HERE is, to erase the dashed line, just for the first list item (li).
Tried both jQuery way ( $("#post0")... ) and Javascript way (above) but both didn't take effect.
.list {
border-style: solid; border-width: 1px;
width: auto;
padding: 0px;
}
.viewPost {
border-style: none;
border-top-style: dashed; border-top-width: 1px;
padding: 0px;
}
classits not supose to be like"class"? curiousborder-type-width?