PDA

View Full Version : I'm looking for a code! Pls help!



STAR
10-31-2006, 12:12 PM
Well i'm actually looking for a code! Do u guy's notice that when u added a new codeing to your site and when u load the page only the original code that load first! after a few moment the newly added codeing then will be loaded out......... So does anyone know any code/ Javascript can make it all newly added coding load together? As for example like the hide code, when u added the hide code to your site it load slow and u still can see the hidden stuff inside the hide code during loading!

So anyone can help????? :(


Look at the link below:

http://animediscussion.orjm.net/index.php?...view=getnewpost (http://animediscussion.orjm.net/index.php?showtopic=163&view=getnewpost)

the site added a center user profile codeing! but it still load with the original code too and doesn't lack while loading, as the forums also hosted by invisionfree! So i think there's sure someone got the code/ Javascript for it!

codeexploiter
10-31-2006, 12:28 PM
The link you provided in your posting seems to be dead. It would be better if you can rephrase what you are looking for.

STAR
10-31-2006, 12:56 PM
I have check the link, it works!

codeexploiter
10-31-2006, 01:04 PM
Check the attached screenshot

STAR
10-31-2006, 01:25 PM
Use IE

blm126
10-31-2006, 10:20 PM
Use IE
no

Anyway, yes there is a reason for this. Most scripts are designed to run when the page has done loading(in order to get all the info). Scripts can be run before the page loads but can't be relied. The only way around this is to use CSS to hide the content.

codeexploiter
11-01-2006, 03:24 AM
Posted : STAR
Use IE


I wonder how a person insist the web users to use a particular browser?

tech_support
11-01-2006, 04:29 AM
codeexploiter: Use [quote=Name] next time.

jscheuer1
11-01-2006, 06:11 AM
blm126 is right for the most part. It depends upon just what the code is though. Also code can be changed to display a loading phrase or graphic instead of simply being hidden. It can also be changed to show something that the script will later show once it initializes after page load. All these strategies depend upon just what the script is. Some scripts can load as the page is parsed and still be perfectly reliable, many cannot.

tech_support
11-01-2006, 08:47 AM
The link works for me.

STAR
11-01-2006, 05:47 PM
no

Anyway, yes there is a reason for this. Most scripts are designed to run when the page has done loading(in order to get all the info). Scripts can be run before the page loads but can't be relied. The only way around this is to use CSS to hide the content.

so how to use CSS to hide the content?

blm126
11-01-2006, 10:14 PM
it depends on what exactly the script is doing and how itis doing it. There is now catch all solution.

jscheuer1
11-02-2006, 01:05 AM
Well, for those willing to do there own work and having a moderate amount of knowledge, generally what you do is put a division around the markup or generated markup of the script, sometimes you should generate this division in the same manner and in the same part of the script as the script's other markup is generated. Give that new division a unique id - say, 'script_container', and set its visibility:hidden in the stylesheet:

#script_container {
visibility:hidden;
}

At the end of the initialization function for the script add this line:


document.getElementById('script_container').style.visibility='visible';

This wil do the trick in most cases.

blm126
11-02-2006, 03:33 AM
document.grtElementById('script_container').style.visibility='visible';
This wil do the trick in most cases.
For some reason I don't think that code will work... :)

jscheuer1
11-02-2006, 05:39 AM
For some reason I don't think that code will work... :)

Typo. Corrected in the original, should be 'getElementById' not 'grt'.

Thanks, Brady.





document.getElementById('script_container').style.visibility='visible';

This wil do the trick in most cases.

STAR
11-02-2006, 02:26 PM
Sorry i don't really get it! So "jscheuer1" do u mind edit it for me?

Heres the CODE:



<!--
/*****************************************
Hidden Content v3 By Beta
This code may not be reposted or redistributed without the creator's permission.
This copyright header must stay intact at all times.
*****************************************/

var errorMsg = " <img src='http://img224.imageshack.us/img224/8269/lockedww9.gif' /> ";

function Frag() {
var _td = document.getElementsByTagName("td");
for(e=0;e<_td.length;e++) {
if(_td[e].className != "pformright" && _td[e].className && _td[e].id != "CODE" && _td[e].innerHTML.match(/\.*?\[\/hide\]/gi)) {
_td[e].innerHTML = _td[e].innerHTML.replace(/\[hide\](.*?)\[\/hide\]/gi,"<span class='message'>" + errorMsg + "</span><span class='hidden' style='display:none'>$1</span>");
}
if(_td[e].className == "pformright" && _td[e].innerHTML.match(/\[hide\].*?\[\/hide\]/gi)) {
_td[e].innerHTML = _td[e].innerHTML.replace(/\[hide\].*?\[\/hide\]/gi,"Hidden Content");
}
}
}
Frag();

function Frame() {
var url = (location.href.match(/showtopic=(\d+)/i))? RegExp.$1 : (location.href.match(/t=(\d+)/i))? RegExp.$1 : null;
if(url != null) {
var iframe = document.createElement("iframe"); iframe.style.display = "none";
iframe.src = location.href.split("index.php")[0] + "index.php?s=&act=Stats&CODE=who&t=" + url;
iframe.name = "datacheck";
iframe.id = "datacheck";
document.getElementsByTagName("head").item(0).appendChild(iframe);
iframe.onload = function() {
var _usr = document.getElementById("userlinks").rows[0].cells[0].getElementsByTagName("a")[0];
var _chk = window.frames["datacheck"];
var _lnks = _chk.document.getElementsByTagName("a");
for(x=0;x<_lnks.length;x++) {
if(_lnks[x].href == _usr.href) {
var _spn = document.getElementsByTagName("span");
for(a=0;a<_spn.length;a++) {
if(_spn[a].className == "hidden" && _spn[a].style.display == "none") {
_spn[a-1].style.display = "none";
_spn[a].style.display = "inline";
}
}
} else {
var _spn = document.getElementsByTagName("span");
for(b=0;b<_spn.length;b++) {
if(_spn[b].className == "hidden" && _spn[b].style.display == "none") {
_spn[b-1].innerHTML = errorMsg;
}
}
}
}
}
} else {
var _spn = document.getElementsByTagName("span");
for(c=0;c<_spn.length;c++) {
if(_spn[c].className == "hidden" && _spn[c].style.display == "none") {
_spn[c-1].innerHTML = errorMsg;
}
}
}
}
Frame();

function Add(){
_td = document.getElementsByTagName("td");
for(e=0;e<_td.length;e++) {
if(_td[e].className == "pformright" && _td[e].innerHTML.match(/Open Tags/i)) {
var help_hide = "Insert Hidden Content tags";
var hide = document.createElement("input");
hide.className = "codebuttons";
hide.onmouseover = function() { hstat("hide"); }
hide.onclick = function() {
var txt = prompt("Enter the text you want to have hidden.","Text Here");
if(txt == null) {
alert("You must enter hidden text");
} else {
document.forms['REPLIER'].Post.value += "[hide]" + txt + "";
}
}
hide.value = " HIDE "; hide.name = "hide";
hide.type = "button";
_td[e].insertBefore(hide,_td[e].getElementsByTagName("input")[3]);
_td[e].insertBefore(document.createTextNode(" "),_td[e].getElementsByTagName("input")[4]);
}
}
}
Add();

//-->


Thx alot!!!

jscheuer1
11-02-2006, 06:27 PM
/*****************************************
Hidden Content v3 By Beta
This code may not be reposted or redistributed without the creator's permission.
This copyright header must stay intact at all times.
*****************************************/

No can do.

Twey
11-02-2006, 06:40 PM
I don't get that phrase. Is it grammatically correct in some obscure dialect of American English? :-\

jscheuer1
11-02-2006, 06:48 PM
I don't get that phrase. Is it grammatically correct in some obscure dialect of American English? :-\

Yes:

'may not be reposted'

- means you can't do it here. :)

Twey
11-02-2006, 07:16 PM
Heh. The importance of using quotes. :p

STAR
11-03-2006, 12:52 AM
Oh really can't edit it for me??? Pls i really needed it..... And i'm only for personal use

blm126
11-03-2006, 01:40 AM
Please refer to rule 1.4 (http://www.dynamicdrive.com/forums/rules.htm). Sorry, no can do. You can take our information and do it yourself, but we can't do it.

STAR
11-03-2006, 07:43 AM
well i have posted the code here, can anyone guide me alone? For example high light the part to be edited with what script??? is it alright?

ultranet
11-06-2006, 09:10 AM
I m still new here...... hope to see related informations here...


thanks