사용전

var id = "kim";
var name = "gildong";
var age = "30"
window.location = 'http://localhost:8080?' + '&id=' + id + '&name=' + name + '&age=' + age;

 

 

사용후

var url = 'http://localhost:8080';
var obj = {
        id : 'kim',
        name : 'gildong',
        age : 30
    };
window.location = url + '?' + $.param(obj);
반응형
Posted by 힘없는염소