[quote=Ladeva XIII]sedikit pertanyaan Bg, sekiranya kita mau 2 content yang kita samakan,
misalnya friend dan comment, itu gmn Bg???[/quote]
makasih repunya :rose:
klo untuk friend dan comment :
[spoiler]FRIENDSHIP = {};
if (!attachOnLoadHandler(function() { FRIENDSHIP.init(); })) window.onload = function() { FRIENDSHIP.init(); };
(function() {
FRIENDSHIP = {
info: {
[b] temen: null,
komentar: null[/b]
},
regexp: {
[b] temen: /id="content_2">([\S\s]*?)<\/div><\/li>/i,
komentar: /id="content_18">([\S\s]*?)<\/div><\/li>/i[/b]
},
init: function() {
try {
ajaxRequest("GET", "http://" + location.hostname + "/" + pageViewerID , true, null, FRIENDSHIP.viewer, null);
} catch(e) {}
},
viewer: function(myfriend) {
if (myfriend.replace(/^\s*|\s*$/g, "") === "") {
alert("Error: Unable to parse user details!");
return;
} else if (myfriend) {
for (var val in FRIENDSHIP.info) {
try {
FRIENDSHIP.info[val] = new RegExp(FRIENDSHIP.regexp[val]).exec(myfriend)[1].replace(/^(\d)$/, "0$1");
} catch(e) {
FRIENDSHIP.info[val] = "";
}
}
document.getElementById("content_2").innerHTML=FRIENDSHIP.info.[b]temen[/b];
document.getElementById("content_18").innerHTML=FRIENDSHIP.info.[b]komentar[/b];
}
}
};
})();[/spoiler]
mo nonton bola lagi aahhh ....
Last edited by nopathz (2008-05-21 15:52:16)