How can I redirect the browser when a button is clicked?
I want to pass a URL on click of a button so the browser can redirect to the URL.
url value = /web/SMI6041001090/home?contId=186&contName=sa
When a user clicks on the button it should redirect to this URL.
var url = document.<portlet:namespace />regForm.fwdURL.value;
alert('url 开发者_Python百科-->'+url);
jQuery('.submit-button').click(function(){
// Pass URL here.
});
I want to pass URL on clik of the button. so browser can redirect to URL.
You mean this:
var url = document.<portlet:namespace />regForm.fwdURL.value;
jQuery('.submit-button').click(function(){
document.location.href = 'http://yoursite.com' + url;
});
精彩评论