开发者

How can I redirect the browser when a button is clicked?

开发者 https://www.devze.com 2023-01-10 01:26 出处:网络
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

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;
});
0

精彩评论

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