Click here to Skip to main content
15,888,077 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

I have been trying to redirect to another page using javascript when an user clicked on the button. This is working perfectly in all the browsers except IE11.

Below is JS function :

C#
function setAccountBts() {
    target.find("div.content a.myaccountbt").click(function () {
        window.location.href = "http://mywebsite.com/Member/MyAccount.aspx";
    });
}


Any help or suggestion would be greatly appreciated.

Thanks
Posted
Comments
Mitchell J. 6-Mar-14 3:17am    
That code, by itself, looks like it ought to work! (to me at least)
Do you have any more information?
Aravindba 6-Mar-14 3:17am    
i think java-script not work properly in ie11

hi
try like this

JavaScript
function setAccountBts()
{
        window.location.href = "http://mywebsite.com/Member/MyAccount.aspx";
    
}


this line not get correct control name in ie11

target.find("div.content a.myaccountbt").click


so in button client click event u call setAccountBts() and check
 
Share this answer
 
Hey Buddy,

I think your JavaScript is disabled on IE, you need to enable your JavaScript on your Browser.

Follow this link to enable your JavaScript.

http://support.microsoft.com/gp/howtoscript[%5E]

If your JavaScript is enabled and still it is not working then you can try

window.top.location="pageurl.aspx".

I had used it in this article:

http://www.c-sharpcorner.com/UploadFile/cd7c2e/how-to-auto-refresh-grid-view-on-closing-of-popup-menu/[^]
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900