简体   繁体   中英

Passing parameters into a url

I need to pass some parameters into a URL

For example, my URL is mypage/generator/

So my generator consists of a generator(code, id, text)

Is the following a correct way of doing it

Check:function () {
    var generator = code + "," + id + ", " + text;
    Window.location.href = "mypage/" + generator + "/"
} 

You can try this:

function check(){
var generator=code +","+ id +","+ text;
window.location.href="mypage?data="+generator+"";
}

and you can access the data from request.getparameter("data");

This might help you!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM