| 1 |
/** |
| 2 |
* |
| 3 |
*/ |
| 4 |
|
| 5 |
var CJTUtilities; |
| 6 |
|
| 7 |
/** |
| 8 |
* |
| 9 |
*/ |
| 10 |
(function($) { |
| 11 |
|
| 12 |
/** |
| 13 |
* put your comment there... |
| 14 |
* |
| 15 |
* @type Object |
| 16 |
*/ |
| 17 |
CJTUtilities = { |
| 18 |
|
| 19 |
/** |
| 20 |
* put your comment there... |
| 21 |
* |
| 22 |
* @param string |
| 23 |
*/ |
| 24 |
parseString : function(str, exp) { |
| 25 |
// Initialize! |
| 26 |
var data = {}; |
| 27 |
var property; |
| 28 |
// Set default expression if not specified. |
| 29 |
exp = exp ? exp : /([^\=\&]+)\=([^\&]+)/g; |
| 30 |
// Get all properties! |
| 31 |
while (property = exp.exec(str)) { |
| 32 |
// Set single item! |
| 33 |
data[property[1]] = property[2]; |
| 34 |
} |
| 35 |
return data; |
| 36 |
} |
| 37 |
|
| 38 |
} // End module! |
| 39 |
|
| 40 |
})(jQuery); |