我不确定是否可能,但我需要这样的东西
答案 0 :(得分:0)
Using URL Parser jQuery plugin
$(document).ready(function(){
var valuePassed=$.url().param('status');
$('#select').val(valuePassed);
});
或使用How can I get query string values in JavaScript?
中解释的vanilla javascript帮助函数function getParameterByName(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" :
decodeURIComponent(results[1].replace(/\+/g, " "));
}
$(document).ready(function(){
var valuePassed=getParameterByName('status');
$('#select').val(valuePassed);
});