Like SystemiConnectFri 15 Oct 2021, 04:50
Auto Save MessagesLGforumFri 26 Feb 2021, 13:31
New tutorial questionTheCrowMon 15 Feb 2021, 08:12
Support iOS Emojis (and other platforms)LGforumSun 14 Feb 2021, 01:25
LGforum (2806)
Return NaN result, why?! Vote_lcapReturn NaN result, why?! Voting_barReturn NaN result, why?! Vote_rcap 
Mr.Easybb (1587)
Return NaN result, why?! Vote_lcapReturn NaN result, why?! Voting_barReturn NaN result, why?! Vote_rcap 
Bloodbath (745)
Return NaN result, why?! Vote_lcapReturn NaN result, why?! Voting_barReturn NaN result, why?! Vote_rcap 
Rukiafan (533)
Return NaN result, why?! Vote_lcapReturn NaN result, why?! Voting_barReturn NaN result, why?! Vote_rcap 
Dom (513)
Return NaN result, why?! Vote_lcapReturn NaN result, why?! Voting_barReturn NaN result, why?! Vote_rcap 
puppycheese (446)
Return NaN result, why?! Vote_lcapReturn NaN result, why?! Voting_barReturn NaN result, why?! Vote_rcap 
pedro (330)
Return NaN result, why?! Vote_lcapReturn NaN result, why?! Voting_barReturn NaN result, why?! Vote_rcap 
Neymar (301)
Return NaN result, why?! Vote_lcapReturn NaN result, why?! Voting_barReturn NaN result, why?! Vote_rcap 
Hitsu (281)
Return NaN result, why?! Vote_lcapReturn NaN result, why?! Voting_barReturn NaN result, why?! Vote_rcap 
Flora (275)
Return NaN result, why?! Vote_lcapReturn NaN result, why?! Voting_barReturn NaN result, why?! Vote_rcap 


Return NaN result, why?!

SSYTSSYT
Status : SSYT 2.0 is here - 2k17

Posts : 12
Join date : 2015-05-05
Age : 29
Tue 03 May 2016, 09:32
Hello, check my code today, and get a bug... return nan result of members...
Code:
NaN users are online (in the past 45 minutes)
NaN members, 0 guests, 0 anonymous users  (See full list)

My Code:
Code:
<script type="text/javascript">
  //<![CDATA[
  ('IP.Board statistics of forumotion forums, by BitCoding.');
  ('Bug Fix v1.0 by SSYT, o.d.f forumotion');
  ('www.bitcoding.tk');
 
  $('#board_statistics p.statistics_brief st').each(function() {
     var arrs = new Array();
     arrs['total'] = $(this).text().match(/\d+/g)[0];
     arrs['users'] = $(this).text().match(/\d+/g)[1];
     arrs['guests'] = $(this).text().match(/\d+/g)[3];
     arrs['invisible'] = $(this).text().match(/\d+/g)[2];
     arrs['bots'] = $(this).text().match(/\d+/g)[4];
     arrs['total2'] = parseInt(arrs.users) + parseInt(arrs.bots);
     arrs['total3'] = parseInt(arrs.total) + parseInt(arrs.bots);
 
     if(arrs.bots != 0) { $(this).replaceWith(''+ arrs.total2 +' members, '+ arrs.guests +' guests, '+ arrs.invisible +' anonymous users'); }
     else { $(this).replaceWith(''+ parseInt(arrs.users) +' members, '+ arrs.guests +' guests, '+ arrs.invisible +' anonymous users'); }
     if(arrs.bots != 0) { vars('{.VIEWV_ONLINES}', arrs.total3 + ' users are online (in the past 45 minutes)'); }
     else { vars('{.VIEWV_ONLINES}', arrs.total + ' users are online (in the past 45 minutes)'); }
  });
  //]]>
</script>
LGforumLGforum
Status : Working to restore AWC!

Posts : 2806
Join date : 2011-10-05
Age : 30
Location : UK
Wed 04 May 2016, 09:58
What you should do is output the contents of the array into the console for bug fixing purposes. You'll be able to see what is causing the issue.

Also [ic]arr.bots != 0[/ic] won't be acting the way you want it to because arr.bots is a string.
SSYTSSYT
Status : SSYT 2.0 is here - 2k17

Posts : 12
Join date : 2015-05-05
Age : 29
Wed 04 May 2016, 19:06
Solved, change
Code:
[panda=js]!= 0
with
Code:
[panda=js]> 0
avatarGuest
Wed 04 May 2016, 20:07
Moved to the archives, since it's solved.
Sponsored content