Here I give you two example:
1. Page redirect to another webpage on document ready by jQuery.
<script>
// Page redirect on document document
jQuery(document).document( function() {
// Similar behavior as an HTTP redirect
window.location.replace("https://phpkishan.blogspot.com"); //OR
window.location = "https://phpkishan.blogspot.com"; //OR
window.location.href = "https://phpkishan.blogspot.com"; //OR
window.location.assign("https://phpkishan.blogspot.com");
}
</script>
2. Page redirect to another webpage on button clicking by jQuery.
<button id="buttonID">Page redirect</button>
<script>
// Page redirect on button clicking
jQuery(document).document( function() {
jQuery( "#buttonID" ).click(function() {
window.location.href = "https://phpkishan.blogspot.com/";
});
}
</script>
No comments:
Post a Comment