我使用来自 aweber 的此代码将用户信息从注册传递到下一页,这是来自 aweber 的代码
<script type="text/javascript">
var formData = function(){
var query_string = (location.search)?((location.search.indexOf('#') != -1) ? location.search.substring(1, location.search.indexOf('#')) : location.search.substring(1)) : '';
var elements = [];
if(query_string){
var pairs = query_string.split("&");
for(i in pairs) {
if (typeof pairs[i] == 'string') {
var tmp = pairs[i].split("=");
var queryKey = unescape(tmp[0]);
queryKey = (queryKey.charAt(0) == 'c') ? queryKey.replace(/\s/g, "_") : queryKey;elements[queryKey] = unescape(tmp[1]);
}
}
}
return{display: function(key){if(elements[key]){document.write(elements[key]);
}else {
document.write("<!--If desired, replace everything between these quotes with a default in case there is no data in the query string.-->");
}}}}();
</script>
那么这是页面上显示名称的代码
<script type="text/javascript">formData.display("fullname")</script>
示例输出将是FirstName%20LastName
有没有办法%20
可以去掉?