common.js 392 B

1234567891011121314151617181920212223242526
  1. function failure(data) {
  2. console.log(data);
  3. alert(data.message);
  4. }
  5. function splitValue(str) {
  6. if (str) {
  7. if (str.length > 0) {
  8. return str.split(',');
  9. }
  10. }
  11. return [];
  12. }
  13. function joinValue(o, split) {
  14. var s = ',';
  15. if (split) {
  16. s = '' + split;
  17. }
  18. if (o) {
  19. if (toString.apply(o) === '[object Array]') {
  20. return o.join(s);
  21. }
  22. }
  23. return o;
  24. }