开发者

In HTML, how can I make a button that reverse sorts a massive [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly开发者_如何学JAVA broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 12 years ago.

In HTML, how can I make a button that reverse sorts a massive.. $m = explode($s) form_method="POST"


I assume you mean client-side, not just HTML. If so, use Array.sort().

http://www.javascriptkit.com/javatutors/arraysort.shtml

"Massive" is a completely relative term, but I have tested Array.Sort with complex object sorts for arrays containing a couple thousand items with no issues.

Simplified, it looks like this.

<input type="button" onclick="PerformSort()" />

<script>

function PerformSort()
{

var arr = [];

// populate 'arr' with items to sort

arr.sort();

// output sorted results to DOM

}

</script>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜