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';
}
精彩评论