Safari 5.1 prompt() function and cancel

后端 未结 5 944
抹茶落季
抹茶落季 2020-12-18 20:00

In most browsers (including older versions of Safari), the Javascript prompt function returns null when the user clicks \"Cancel\", and the empty s

5条回答
  •  一向
    一向 (楼主)
    2020-12-18 20:43

    I tryed and this worked for me

        var location="";
        var p=prompt("type your location",location ); 
    
    if(p!==null)   {    location = p;    alert("ok do query");   }
    

提交回复
热议问题