Reputation: 2367
I have this function after an ajax post.
success: function(){
window.location = 'morefive.php?document=' + path;
}
I wanted to know how I could pass two variables, I have been having trouble figuring this out for jquery. It would be the equivalent of morefive.php?document=path&url=link
the variable link being a url (would it have to be encoded?)
Upvotes: 1
Views: 919
Reputation: 1744
If i understand your question, you need to use encodeURIComponent() like this:
window.location = 'morefive.php?document=' + path + '&url=' + encodeURIComponent(link);
Upvotes: 1
Reputation: 360572
window.location = 'movefive.php?document=' + path + '&url=' + linkvar
Nothing says you can't concatenate multiple strings/variables together. Just separate each var=value
pair with a &
character.
Upvotes: 0