how to get url value after question mark in javascript

前端 未结 2 1950
闹比i
闹比i 2021-01-17 17:35

How can I get the url value after a question mark in javascript?

I want the following behaviour:

if value is yes then 10+2 
else if value is no then          


        
相关标签:
2条回答
  • 2021-01-17 18:13

    use javsacript and type:

    location.search
    
    0 讨论(0)
  • 2021-01-17 18:32

    use this code:

    var a = location.href; 
    var b = a.substring(a.indexOf("?")+1);
    
    0 讨论(0)
提交回复
热议问题