2008-06-16 15:53:04

Refresh/Reload
» FTalkAddict
FTalk Level: zero
332
0
1969-12-31

Re: [spoiler][b]Do not remove these notices[/b] [quote=eehjhay]Due to Major Forum Clean-up, some old topics related to linkers will be moved to [url=http://theftalk.com/f52-Archives.html]Archive[/u

[quote=kielmaru_07]Waah~ what shud i doo!!?[/quote] just an advice.... and sorry for me being out of the topic... one of your biggest mistake is using a multiple onloadhandler if you already have one... it's a no-no :thumbsdown: you have to use only one for all your js compilation... let's take one of your codes with an onloadhandler for example... [quote][color=red]if ( ! attachOnLoadHandler(function () { cHeaders();})) window.onload = function () { cHeaders();}; function cHeaders() {[/color] [b]REPLACEIT.init();[/b] [b]}[/b] if (typeof REPLACEIT == "undefined") { REPLACEIT = {}; } REPLACEIT = { head: [], init: function() { this.head = this.getModuleByClassName(/controlpanel/i)[0].getElementsByTagName("h1")[0]; this.head.innerHTML = "Kiel Maru M. Vasquez"; this.head = this.getModuleByClassName(/photos/i)[0].getElementsByTagName("h2")[0]; this.head.innerHTML = "Photo comments pls!"; this.head = this.getModuleByClassName(/blogs/i)[0].getElementsByTagName("h2")[0]; this.head.innerHTML = "Read my blog! "; this.head = this.getModuleByClassName(/reviews/i)[0].getElementsByTagName("h2")[0]; this.head.innerHTML = "Reviews"; this.head = this.getModuleByClassName(/moreabout/i)[0].getElementsByTagName("h2")[0]; this.head.innerHTML = "You must not know bout me! LOL"; this.head = this.getModuleByClassName(/publiccomments/i)[0].getElementsByTagName("h2")[0]; this.head.innerHTML = "Gimme a comment!"; this.head = this.getModuleByClassName(/scrapbook/i)[0].getElementsByTagName("h2")[0]; this.head.innerHTML = "Haha!"; this.head = this.getModuleByClassName(/friends/i)[0].getElementsByTagName("h2")[0]; this.head.innerHTML = "My Prends!"; this.head = this.getModuleByClassName(/fanof/i)[0].getElementsByTagName("h2")[0]; this.head.innerHTML = "Im a fan of!.."; this.head = this.getModuleByClassName(/groups/i)[0].getElementsByTagName("h2")[0]; this.head.innerHTML = "Tropapeeps."; }, getModuleByClassName: function(sClass) { var elm = []; var els = document.getElementsByTagName("*") || document.all; for (var j=0,k=els.length;j<k;j++) { if (new RegExp(sClass).test(els[j].className))elm.push(els[j]); } return elm; } };[/quote] that [color=red]RED[/color] part is an onloadhandler... you don't need that coz you already have this... [quote]if (!attachOnLoadHandler(function(){onProfileLoad()})) window.onload = function(){onProfileLoad()}; function onProfileLoad() {[/quote] which is your main onloadhandler... so all you have to do is to [b]omit/delete[/b] all those [color=red]RED[/color] part and those [b]BOLD[/b] part... [b]BUT... [/b]you have to put back the .init or the one to be called inside your main onloadhandler... so your compilation would be like this... [quote]//you can put codes here if (!attachOnLoadHandler(function(){onProfileLoad()})) window.onload = function(){onProfileLoad()}; function onProfileLoad() { //you can put codes here //addboxes codes here(mainbox or sidebox) [b]REPLACEIT.init();[/b] [b]}[/b] //addBox function here... //etc. etc... //rest of your REPLACEIT codes here...[/quote] or [quote]/you can put codes here function onProfileLoad() { //you can put codes here //addboxes codes here(mainbox or sidebox) [b]REPLACEIT.init();[/b] [b]}[/b] if (!attachOnLoadHandler(function(){onProfileLoad()})) window.onload = function(){onProfileLoad()}; //addBox function here... //etc. etc... //rest of your REPLACEIT codes here...[/quote] let's take some codes in your js extension as an example again... just a shortcut example/illustration... [quote]// css injection var css = document.createElement("link"); css.setAttribute("rel","stylesheet"); css.setAttribute("href","http://h1.ripway.com/username/cssname.css"); document.getElementsByTagName("head")[0].appendChild(css); function onProfileLoad() { var header="My Mp3"; var code="<CENTER><embed src=\"http://www.loudfusion.com/widgets/music/5\" name=\"Loudfusion.com\" quality=\"high\" wmode=\"transparent\" flashvars=\"USERID=612961\" width=\"250\" height=\"100\" type=\"application/x-shockwave-flash\"></embed></CENTER>"; addBox(header,code,"custombox_767",/commonbox[\s]*?fanof/i); [b]REPLACEIT.init();[/b] [b]}[/b] if (!attachOnLoadHandler(function(){onProfileLoad()})) window.onload = function(){onProfileLoad()}; //addBox function here... //etc. etc... if (typeof REPLACEIT == "undefined") { REPLACEIT = {}; } REPLACEIT = { head: [], init: function() { this.head = this.getModuleByClassName(/controlpanel/i)[0].getElementsByTagName("h1")[0]; this.head.innerHTML = "Kiel Maru M. Vasquez"; this.head = this.getModuleByClassName(/photos/i)[0].getElementsByTagName("h2")[0]; this.head.innerHTML = "Photo comments pls!"; this.head = this.getModuleByClassName(/blogs/i)[0].getElementsByTagName("h2")[0]; this.head.innerHTML = "Read my blog! "; this.head = this.getModuleByClassName(/reviews/i)[0].getElementsByTagName("h2")[0]; this.head.innerHTML = "Reviews"; this.head = this.getModuleByClassName(/moreabout/i)[0].getElementsByTagName("h2")[0]; this.head.innerHTML = "You must not know bout me! LOL"; this.head = this.getModuleByClassName(/publiccomments/i)[0].getElementsByTagName("h2")[0]; this.head.innerHTML = "Gimme a comment!"; this.head = this.getModuleByClassName(/scrapbook/i)[0].getElementsByTagName("h2")[0]; this.head.innerHTML = "Haha!"; this.head = this.getModuleByClassName(/friends/i)[0].getElementsByTagName("h2")[0]; this.head.innerHTML = "My Prends!"; this.head = this.getModuleByClassName(/fanof/i)[0].getElementsByTagName("h2")[0]; this.head.innerHTML = "Im a fan of!.."; this.head = this.getModuleByClassName(/groups/i)[0].getElementsByTagName("h2")[0]; this.head.innerHTML = "Tropapeeps."; }, getModuleByClassName: function(sClass) { var elm = []; var els = document.getElementsByTagName("*") || document.all; for (var j=0,k=els.length;j<k;j++) { if (new RegExp(sClass).test(els[j].className))elm.push(els[j]); } return elm; } }; //etc. etc....[/quote] so if you're going to add another js codes with an onloadhandler again just omit/delete it and just add the codes to be called then put the rest of the codes below the first code... ex: [b]REPLACEIT.init();[/b] [b]SPAWNPIC.init();[/b] [b]}[/b] note: just compile the codes base on who will be called first... and if you have a WVM tracker code... do that steps also... hope you got the idea... :D and don't use same [b]var names[/b]... that's a no-no also... you named all your sideboxes as [b]var header[/b]... just change it... along with the box ID... hope this one helps... :paranoid:

Last edited by Refresh/Reload (2008-06-16 16:13:37)

Board footer

© 2024 F Talk

Current time is 23:52

[ 13 queries - 0.177 second ]
Privacy Policy