Biasanya kita customize profile kan pke css.....
Percaya atau ga kita bisa customize profil kita pake javascript dan tanpa css tapi terlihat seperti memakai css. Lho bingung kan...?
[b]Recommended For Advanced JS User[/b]
Okay, kita mulai aja tutorialnya:
[quote]document.getElementById("[b]mainnav[/b]").getElementsByTagName("[b]div[/b]")[1].style.[b]display="none"[/b];[/quote]
Kode diatas adalah contoh kodenya. Dan yang di bold dapat di edit sesuka hati. JavaScript diatas bisa bertindak sebagai css. Bisa dilihat dengan jelas dari script diatas.
[quote][b]
Penjelasan Lebih Lanjut:[/b]
[quote]document.getElementById("[b]mainnav[/b]")[/quote]
bertindak untuk mendapatkan elemen2 dari [b]mainav[/b] (id box).
[quote]getElementsByTagName("[b]div[/b]")[/quote]
berfungsi untuk mendapatkan elemen2 dari tag [b]div[/b]
dan [quote]style.[b]display="none"[/b];[/quote]
berfungsi untuk customize style dari box [b]"mainav"[/b] menjadi hidden.[/quote]
Dan selain [quote]style.[b]display="none"[/b];[/quote]
kita juga dapat menyisipkan innerHtml.
Contoh:
[quote]document.getElementBy[b]Id[/b]("[b]content_0[/b]").[b]innerHTML[/b]="[b]Kode HTML disini................[/b]";[/quote]
[quote][b]
content_0[/b]= id box
[b]Kode HTML disini................[/b]= tempat untuk memasukan code html
[b]innerHTML[/b]= script yg dapat dimasukkan selain .style[/quote]
Variasi kode getElementBy:
[quote]document.getElementBy[b]Id[/b]
document.getElementBy[b]Tag[/b]
document.getElementBy[b]Class[/b][/quote]
Study More From Shirow Masamune:
[quote=Shirow Masamune]Control Panel
[quote]document.getElementById("content_0").innerHTML="PUT ANYTHING HERE";[/quote]
Photos
[quote]document.getElementById("content_1").innerHTML="PUT ANYTHING HERE";[/quote]
Friends
[quote]document.getElementById("content_2").innerHTML="PUT ANYTHING HERE";[/quote]
About Me
[quote]document.getElementById("content_6").innerHTML="PUT ANYTHING HERE";[/quote]
Fan of
[quote]document.getElementById(content_"7").innerHTML="PUT ANYTHING HERE";[/quote]
Groups
[quote]document.getElementById("content_8").innerHTML="PUT ANYTHING HERE";[/quote]
Media Box
[quote]document.getElementById("content_10").innerHTML="PUT ANYTHING HERE";[/quote]
Reviews
[quote]document.getElementById("content_12").innerHTML="PUT ANYTHING HERE";[/quote]
Google Ads
[quote]document.getElementById("content_14").innerHTML="PUT ANYTHING HERE";[/quote]
Meetrail(how we are connected)
[quote]document.getElementById("content_15").innerHTML="PUT ANYTHING HERE";[/quote]
Testimonials and comments
[quote]document.getElementById("content_18").innerHTML="PUT ANYTHING HERE";[/quote]
Main Navigation(home profile search etc...)
[quote]document.getElementById("mainnav").innerHTML="PUT ANYTHING HERE";[/quote]
Sub Navigation(Message Log out etc...)
[quote]document.getElementById("subnav").innerHTML="PUT ANYTHING HERE";[/quote]
Google Search
[quote]document.getElementById("search").innerHTML="PUT ANYTHING HERE";[/quote]
Friendster Logo(the smilie)
[quote]document.getElementById("logo").innerHTML="PUT ANYTHING HERE";[/quote]
Language Panel(Japanese Korean Spanish Chinese blah blah)
[quote]document.getElementById("navLang").innerHTML="PUT ANYTHING HERE";[/quote]
Surfer
[quote]document.getElementById("surfer").innerHTML="PUT ANYTHING HERE";[/quote]
Marketing(this is not a market lol)
[quote]document.getElementById("marketing").innerHTML="PUT ANYTHING HERE";[/quote]
For the lower part
Footer
[quote]document.getElementById('footer_container').innerHTML = "PUT ANYTHING HERE";[/quote]
Control Panel Data(This will replace your login details including your URL, last login, hometown and more.)
[quote]document.getElementById("0").getElementsByTagName("ul")[1].innerHTML="PUT ANYTHING HERE";[/quote]
Recent Updates
[quote]document.getElementById("0").getElementsByTagName("ul")[2].innerHTML="PUT ANYTHING HERE";[/quote]
Shout Out Box
[quote]document.getElementById('cpShoutoutBox').innerHTML="PUT ANYTHING HERE";[/quote]
Control Panel Buttons
[quote]document.getElementById("controlPanelButtons").innerHTML="PUT ANYTHING HERE";[/quote]
For the view all links
View All Comment/Post a comment link(upper part)
[quote]document.getElementById('content_18').getElementsByTagName("div")[0].innerHTML="PUT ANYTHING HERE";[/quote]
View All Comment/Post a comment link(lower part)
[quote]document.getElementById('content_18').getElementsByTagName("div")[21].innerHTML="PUT ANYTHING HERE";[/quote]
[/quote]
Original Link:
http://theftalk.com/t20552-Compilation-innerHTML-Replacement-Modules.html
How to use Replacement Module With Nicer way:
[quote][b]var ymm0t[/b] = "<div align='left'>Kakkakakakakka<a href='http://theftalk.com/' target='blank'>FriendsterTalk</a><br> Wkwkwkwkwkwk<img src='http://www.anikaos.com/anime_animated_gifs/hamtaro/serie/hamtaro_s_018.gif' alt='hamtaro'></div>";
document.getElementById("mainav").innerHTML="[b]"+ymm0t+"[/b]";[/quote]
Nah cara diatas adalah cara yg paling bagus untuk membuat rapih js kita dan mempermudah kita buat ngedit.
[b]Penjelasan:[/b]
Lihat kode:
[quote][b]var ymm0t[/b] = "<div align='left'>Kakkakakakakka<a href='http://theftalk.com/' target='blank'>FriendsterTalk</a><br> Wkwkwkwkwkwk<img src='http://www.anikaos.com/anime_animated_gifs/hamtaro/serie/hamtaro_s_018.gif' alt='hamtaro'></div>";[/quote]
kode diatas itu adalah script variable. jadi maksudnya:
variable ymm0t itu sama aja [quote]<div align='left'>Kakkakakakakka<a href='http://theftalk.com/' target='blank'>FriendsterTalk</a><br> Wkwkwkwkwkwk<img src='http://www.anikaos.com/anime_animated_gifs/hamtaro/serie/hamtaro_s_018.gif' alt='hamtaro'></div>[/quote]
Trus lihat [quote]document.getElementById("mainav").innerHTML="[b]"+ymm0t+"[/b]";[/quote]
nah "+ymm0t+" berarti kita menambahkan variable ymm0t kedalamnya jadi bisa dibilang ini:[quote]document.getElementById("mainav").innerHTML="[b]<div align='left'>Kakkakakakakka<a href='http://theftalk.com/' target='blank'>FriendsterTalk</a><br> Wkwkwkwkwkwk<img src='http://www.anikaos.com/anime_animated_gifs/hamtaro/serie/hamtaro_s_018.gif' alt='hamtaro'></div>[/quote]
[/b]";
sama aja kayak
[quote]document.getElementById("mainav").innerHTML="[b]"+ymm0t+"[/b]";[/quote]
tapi lebih simple dan neat gitu.
[b]CreateElement[/b]
contoh kode yg menggunakan CreateElement:
[quote]var myjs = [b]document.createElement("script");[/b]
myjs.[b]type = "text/javascript";[/b]
myjs.[b]src = "JS URL";[/b]
[b]document.getElementsByTagName("head")[0][/b][b].appendChild(myjs);[/b][/quote]
Itu dia contoh kodenya. Kode diatas biasa kita sebut sebagai: JS Injection
[quote]var myjs = [b]document.createElement("script");[/b][/quote]
berarti variabel myjs sama dengan membuat elemen [b]script[/b]
[quote]myjs.[b]type = "text/javascript";[/b][/quote]
Berarti type dari element tersebut: text/javascript
[quote]myjs.[b]src = "JS URL";[/b][/quote]
Berarti menambahkan source atau asal dari elemen yg ingin kita buat
[quote][b]document.getElementsByTagName("head")[0][/b][b].appendChild(myjs);[/b][/quote]
Nah klo yg ini kan sudah saya jelsakan di atas.
Mari kita coba yg lain:
[quote]var myjs = [b]document.createElement("iframe");[/b]
myjs.[b]src = "url html source";[/b]
[b]document.getElementsByTagName("body")[0][/b][b].appendChild(myjs);[/b][/quote]
[quote]var myjs = [b]document.createElement("embed");[/b]
myjs.[b]src = "swf url source";[/b][/quote]
Jadi yg ingin saya sampaikan adalah Replacement Modules, Fungsi getElementBy, and CreateElement dapat dikombinasikan menjadi satu.
That's all for now. Saya akan update lagi klo menemukan hal2 yang baru.