¡@

Home 

2014/10/16 ¤W¤È 12:07:28

jquery Programming Glossary: s.split

date Sorting Problem with Jquery Tablesorter

http://stackoverflow.com/questions/1707840/date-sorting-problem-with-jquery-tablesorter

return d 1 4 d 1 2 d 1 2 d 1 2 d 1 2 d 1 2 . d .test s format function s s s.replace g s s.replace g s s.replace . g s s.split return .tablesorter.formatFloat new Date s 0 s 1 1 s 2 s 3 s 4 s 5 .getTime parseInt s 6 type numeric Now just apply it..

how to get GET and POST variables with JQuery?

http://stackoverflow.com/questions/439463/how-to-get-get-and-post-variables-with-jquery

var _GET document.location.search.replace ^ ^ g function function decode s return decodeURIComponent s.split .join _GET decode arguments 1 decode arguments 2 document.write _GET test For POST parameters you can serialize the _POST.. to use the built in json_encode function. Update Here's a more generic implementation function getQueryParams qs qs qs.split .join var params tokens re ^ ^ g while tokens re.exec qs params decodeURIComponent tokens 1 decodeURIComponent tokens 2..

Using jQuery tablesorter to sort mm/yy dates

http://stackoverflow.com/questions/450936/using-jquery-tablesorter-to-sort-mm-yy-dates

this parser is not auto detected return false format function s format your data for normalization var dateSplit s.split ' ' if 2 dateSplit.length return 0 return new Date dateSplit 1 dateSplit 0 1 set type either numeric or text type 'numeric'.. you can adjust your format method to format function s table cell format your data for normalization var dateSplit s.split ' ' var year cell .attr 'rel' if 2 dateSplit.length return 0 return new Date year dateSplit 0 1 Or at least similar to that...

Test if date is Valid

http://stackoverflow.com/questions/5812220/test-if-date-is-valid

a date string is to convert to a date object and test that e.g. Expect input as d m y function isValidDate s var bits s.split ' ' var d new Date bits 2 bits 1 1 bits 0 return d d.getMonth 1 bits 1 d.getDate Number bits 0 You only need to test 2 of.. to test 2 of the 3 parts of the date. You can also test the bits of the date string function isValidDate2 s var bits s.split ' ' var y bits 2 m bits 1 d bits 0 Assume not leap year by default note zero index for Jan var daysInMonth 31 28 31 30 31..