开发者

Append a var to url with jquery function

开发者 https://www.devze.com 2023-03-17 09:05 出处:网络
I am looking to append a var to a url with a function that i have bounf to a click event. Say the url is www.example.com

I am looking to append a var to a url with a function that i have bounf to a click event.

Say the url is www.example.com

after running the function it becomes.

www.example.com?folder=beats

I have got the function grabbing the right folder value but need to append it to the current page url.

fun开发者_开发技巧ction fileDialogStart() {

$folder = $('#ams3Folder').val();



}

any help


function fileDialogStart() 
{
    var newURLString = window.location.href + 
            "?folder=" + $('#ams3Folder').val();

    window.location.href = newURLString;    // The page will redirect instantly 
                                            // after this assignment
}

For more information, go here.


function fileDialogStart() {

$folder = $('#ams3Folder').val();

window.location.href = window.location.href + $folder

// window.location.href = window.location.href + '?test=10';

}
0

精彩评论

暂无评论...
验证码 换一张
取 消