html get方法 - 两个单词的值问题

every request with country name as an one word goes through, only "united kingdom" doesn't.

$("#content").load('view.php?country=united kingdom');

many thanks

Try with encodeURI:

$("#content").load(encodeURI('view.php?country=united kingdom'));

Escape United Kingdom using encodeURIComponent, mainly to replace the space with a plus sign.

Example:

country = "united kingdom";
$("#content").load('view.php?country=' + encodeURIComponent(country));

Alternatively, use the .load data parameter, which is automatically escaped.

$("#content").load('view.php', { country: "united kingdom" });