Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 1014 Vote(s) - 3.51 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Jscript to check defined array

#1
My code gathers all categories from a CSV file, sorts and grabs top 10 categories and the top 10 result are displayed on a chart. The code works fine if the gategory found is 10, but if it is less than 10 no chart is displayed..basically code dies.

I am a newbie when it comes to coding and the code was passed on to me by someone else who is not available. What I would like to add is an if cases that checks:

- Gather all category, sort
Set category to 1 to 10
- if category is null, stop. Chart has no value
- if category=1 ===> Display found value
- if category=2 ===> Display found value
- if category=3 ===> Display found value
- if category=3 ===> Display found value
- So on, so on..untill it reaches to 10

<br/>

//collect top 10 cat from array
catArray.sort(sort_by("count", false, function (a) {
return parseInt(a)
}));
var categorytop10 = new Array(catArray[0]["tier3"], catArray[1]["tier3"], catArray[2]["tier3"], catArray[3]["tier3"], catArray[4]["tier3"], catArray[5]["tier3"], catArray[6]["tier3"], catArray[7]["tier3"], catArray[8]["tier3"], catArray[9]["tier3"]);

var categorytop10Count = new Array(catArray[0]["count"], catArray[1]["count"], catArray[2]["count"], catArray[3]["count"], catArray[4]["count"], catArray[5]["count"], catArray[6]["count"], catArray[7]["count"], catArray[8]["count"], catArray[9]["count"]);


Any help is appreciated. Thanks
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through