ÿþ/ * 
 
 Q u e r y D a t a . j s 
 
 A   f u n c t i o n   t o   p a r s e   d a t a   f r o m   a   q u e r y   s t r i n g 
 
 C r e a t e d   b y   S t e p h e n   M o r l e y   -   h t t p : / / c o d e . s t e p h e n m o r l e y . o r g /   -   a n d   r e l e a s e d   u n d e r 
 t h e   t e r m s   o f   t h e   C C 0   1 . 0   U n i v e r s a l   l e g a l   c o d e : 
 
 h t t p : / / c r e a t i v e c o m m o n s . o r g / p u b l i c d o m a i n / z e r o / 1 . 0 / l e g a l c o d e 
 
 * / 
 
 f u n c t i o n   Q u e r y D a t a ( _ 1 , _ 2 ) { 
 i f ( _ 1 = = u n d e f i n e d ) { 
 _ 1 = l o c a t i o n . s e a r c h ? l o c a t i o n . s e a r c h : " " ; 
 } 
 i f ( _ 1 . c h a r A t ( 0 ) = = " ? " ) { 
 _ 1 = _ 1 . s u b s t r i n g ( 1 ) ; 
 } 
 i f ( _ 1 . l e n g t h > 0 ) { 
 _ 1 = _ 1 . r e p l a c e ( / \ + / g , "   " ) ; 
 v a r   _ 3 = _ 1 . s p l i t ( / [ & ; ] / g ) ; 
 f o r ( v a r   _ 4 = 0 ; _ 4 < _ 3 . l e n g t h ; _ 4 + + ) { 
 v a r   _ 5 = _ 3 [ _ 4 ] . s p l i t ( " = " ) ; 
 v a r   _ 6 = d e c o d e U R I C o m p o n e n t ( _ 5 [ 0 ] ) ; 
 v a r   _ 7 = _ 5 . l e n g t h > 1 ? d e c o d e U R I C o m p o n e n t ( _ 5 [ 1 ] ) : " " ; 
 i f ( _ 2 ) { 
 i f ( ! ( _ 6   i n   t h i s ) ) { 
 t h i s [ _ 6 ] = [ ] ; 
 } 
 t h i s [ _ 6 ] . p u s h ( _ 7 ) ; 
 } e l s e { 
 t h i s [ _ 6 ] = _ 7 ; 
 } 
 } 
 } 
 } ; 
 
