Created
          May 5, 2020 15:46 
        
      - 
      
 - 
        
Save jpalala/7c8866851c8c4bac6049fb6ddbe819ee to your computer and use it in GitHub Desktop.  
    searchparams using location.search
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <!doctype html> | |
| <html> | |
| <script> | |
| var search = location.search; | |
| var paramsString = "?p=2&topic=api"; | |
| //var searchParams = new URLSearchParams(paramsString); | |
| var searchParams = new URLSearchParams(search); | |
| console.log('s: ', search); | |
| console.log(searchParams.get("p")); | |
| </script> | |
| </html> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | python -m SimpleHTTPServer | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment