I want to click on link and I want to go to the page on home page by it self
<a onclick="javascript:GoToHomePage()" href="javascript:void(0)">Home page</a>
function is
function GoToHomePage()
{
window.location = 'default.aspx';
}
but i want the url of page www.testtest.com instead of www.testtest.com/default.aspx
I can't even give the absolute path like www.testtest.com as it's a portal and same page coming in few more portals.
Try this: window. location = '/'; Executing this code will send your visitor directly to the root of your website.
You should use addEventListener() instead."
The "Cannot read property 'click' of undefined" error occurs when trying to call the click() method on an undefined value. To solve the error, run the JS script after the DOM elements are available and make sure you only call the method on valid DOM elements.
onClick = function () { alert(1); // To test the click }; var link = $("<a>"+ $("#attachmentName"). text() +"</a>"); $("#attachmentName"). html($(link); link.
Try this:
window.location = '/';
Executing this code will send your visitor directly to the root of your website.
following code will take you to '//www.testtest.com/'
function GoToHomePage()
{
window.location = '/';
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With