You are viewing a post by ymm0t. View all 45 posts in [hr][hr] [align=center][b]FYI.[/b] Thread ini udah lama beud sbnr nya. Cuma skrg gw rapihin aja. Biar lebih enak di liat dan gampang di cari. Dan gw minta maap sblm nya buat member yg postingan nya mu.
[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]