Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HELP: How Can I Use This Javascript Code?
#1
Hw can i use dis javascript .
Is it dpro i wil use 2 wrap my ::msg::
<div align="center"><script language="javascript">
msg = document.getElementsByName('dpro').length;
for(i=0;i<msg;i++){
txt = document.getElementsByName('dpro')[i].innerHTML;
txt = txt.replace(/\[PARA]/ig,'<span name="first_para'+i+'">');
txt = txt.replace(/\[NEXT]/ig,'</span><span name="col_para'+i+'" class="col_para">');
txt = txt.replace(/\[\/PARA]/ig,'</span><div name="page_para'+i+'"></div>');
document.getElementsByName('dpro')[i].innerHTML=txt;
dem = document.getElementsByName('col_para'+i).length;
for(j=0;j<dem;j++){
page = '<a onclick="show(\''+i+'\',\''+j+'\')" class="page_paras" id="page_para'+j+'" name="colpage_para'+i+'">('+(j+1)+' of '+(dem+1)+') Next→</a>';
document.getElementsByName('page_para'+i)[0].innerHTML+=page;
}
}

function show(i,j){
document.getElementsByName('first_para'+i)[0].style.display='none';
if(j>0){
document.getElementsByName('col_para'+i)[j-1].style.display='none';
}
document.getElementsByName('col_para'+i)[j].style.display='inline';
document.getElementsByName('colpage_para'+i)[j].style.display='none';
document.getElementsByName('colpage_para'+i)[j*1+1].style.display='inline';
}
</script></div>
#2
Yes <div name="dpro">::msg::</div> but i dont know how many times, u can ask @horlacoded @mattizzy @bfaschat @tjhenry @yohans and others, am not that good in javascript
I am a proud member of NIgerian Coders Team
Reply
#3
My question is what are you trying to do with that JavaScript Code?
It takes so long to learn simplicity.
Reply
#4
(10-28-2016, 08:15 AM)Dealwap Wrote:
My question is what are you trying to do with that JavaScript Code?


it looks like pagination code, Look at the code very well.
Reply
#5
(10-28-2016, 10:55 AM)Godstime Ukado Nwachukwu Wrote:
it looks like pagination code, Look at the code very well.



Yeah, I want to be sure he understand what he's trying to do.
It takes so long to learn simplicity.
Reply
#6
Its forum pagination.
I am a proud member of NIgerian Coders Team
Reply
#7
(10-28-2016, 11:37 AM)Dealwap Wrote:
Yeah, I want to be sure he understand what he's trying to do.


Okay Bro
Reply
#8
the code enables the poster to show next button inside post like wp sites that always say read next post. it'd advanced functions ... the creator of this code is really good. cool one
I am the CEO of BFASCHAT INC. All i dream about is a free world with no attachment in payment. If you like my works visit our site http://www.nulldip.gq
Reply
#9
(10-29-2016, 08:09 AM)Bfaschat Wrote:
the code enables the poster to show next button inside post like wp sites that always say read next post. it'd advanced functions ... the creator of this code is really good. cool one

Will the code works like that?
Reply
#10
yes it will work and it should be placed in the forum bottom not message in forum


sorry the code has errors that should be fixed. it has incomplete variant declaration so can't work. let me fix it and paste a working one
I am the CEO of BFASCHAT INC. All i dream about is a free world with no attachment in payment. If you like my works visit our site http://www.nulldip.gq
Reply
#11
(10-29-2016, 08:28 AM)Bfaschat Wrote:
yes it will work and it should be placed in the forum bottom not message in forum


sorry the code has errors that should be fixed. it has incomplete variant declaration so can't work. let me fix it and paste a working one


thank you, i will need this also Big Grin
Reply
#12
I have tried my best to correct the code and i hope that it works out for you all but if otherwise then dont worry will try to code another method for you guys


Code:
<div align="center"><script language="javascript">
msg = document.getElementsByName('dpro').length;
for(i=0;i<msg;i++){
txt = document.getElementsByName('dpro')[i].innerHTML;
txt = txt.replace(/\[PARA]/ig,'<span name="first_para'+i+'">');
txt = txt.replace(/\[NEXT]/ig,'<span name="col_para'+i+'" class="col_para">');
txt = txt.replace(/\[\/PARA]/ig,'</span><div name="colpage_para'+i+'"></div>');
txt = txt.replace(/\[\/NEXT]/ig,'</span><div name="colpage_para'+i+'"></div>');
document.getElementsByName('dpro')[i].innerHTML=txt;
dem = document.getElementsByName('col_para'+i).length;
for(j=0;j<dem;j++){
page = '<a onclick="show(\''+i+'\',\''+j+'\')" class="page_paras" id="colpage_para'+j+'" name="colpage_para'+i+'">('+(j+1)+' of '+(dem+1)+') Next→</a>';
document.getElementsByName('colpage_para'+i)[0].innerHTML+=page;
}
}

function show(i,j){
document.getElementsByName('first_para'+i)[0].style.display='none';
if(j>0){
document.getElementsByName('col_para'+i)[j-1].style.display='none';
}
document.getElementsByName('col_para'+i)[j].style.display='inline';
document.getElementsByName('colpage_para'+i)[j].style.display='none';
document.getElementsByName('colpage_para'+i)[j*1+1].style.display='inline';
}
</script></div>


copy the code and paste it in your bottom forum autocontent and then try to use [NEXT] POST[/NEXT] for next and [PARA]POST[/PARA] for previous and see. wish you success.

Copy below

¶¶¶


I am the CEO of BFASCHAT INC. All i dream about is a free world with no attachment in payment. If you like my works visit our site http://www.nulldip.gq
Reply
#13
@bfaschat then we encode our ::msg:: with dpro ? Again, where are we to use the NEXT and PARA tags?? Is it when posting a topic? Whats d actually function of this code pls, broad explanations
I am a proud member of NIgerian Coders Team
Reply
#14
Dis code was coded by don emi.i tank hym anyday anytym


Check http://jiveloaded.ga/forum2_theme_112331...tml?tema=1 its nt d same tin as http://nollylovers.wapka.me/forum2_theme...ml?tema=27
I am a proud member of NIgerian Coders Team
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Can I Create Mobile App On Javascript? mogulkahn 2 8 10-11-2018, 05:32 PM
Last Post: Deelino
  ALERT:  Best Way To Convert Number To String In Javascript jonath45 7 142 08-30-2018, 09:06 AM
Last Post: Cavdy
  HELP: Come And Help Me With This Code Dilfgem 17 454 07-03-2018, 08:58 PM
Last Post: Dilfgem
  ALERT:  Ultimate Javascript Challenge jonath45 19 406 06-29-2018, 07:01 PM
Last Post: jonath45
  HELP: Pls What Are The Major Uses Of Javascript Broomboss 18 499 03-17-2018, 10:17 PM
Last Post: Broomboss
  TUTORIAL: Take A Selfie With Javascript SamBlingxZ 1 211 01-23-2018, 08:46 PM
Last Post: Broomboss
  SHARED: Introducing Hbot.js Javascript Ai Library devHammed 3 289 11-08-2017, 10:13 AM
Last Post: devHammed
  SHARED: Introducing Hrouter.js Javascript Routing Library devHammed 7 227 10-16-2017, 10:13 PM
Last Post: iamdannyfc
  SHARED: Introducing Hkwest.js Javascript Ajax Library devHammed 0 126 10-15-2017, 09:46 AM
Last Post: devHammed
  HELP: Javascript Vs Jquery. beme 10 489 08-21-2017, 07:20 AM
Last Post: beme



Users browsing this thread: 1 Guest(s)

About Nigeria's Creative Talents

Nigeria's Creative Talents is an online community where every creative Nigerians can share ideas with themselves.

For any more information, please use our contact form.

              User Links

              Advertise