Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery redirect to url

$(location).attr('href', 'https://google.com');
Comment

How can I redirect the user from one page to another using jQuery or pure JavaScript?

Solution #1
for Jquery you can use following code
$(location).prop('href', 'https://www.codegrepper.com/profile/shafeeque-ahmad')

Solution #2
for pure javascript you can use following solution

window.location.href='otherpage.com';
 window.location.assign('otherpage.com');
 //and...

 window.location.replace('otherpage.com');
Comment

PREVIOUS NEXT
Code Example
Javascript :: remove same occurances in two different arrays js 
Javascript :: jquery translate 
Javascript :: js today set time 
Javascript :: laravel variable in javascript 
Javascript :: create json string c# 
Javascript :: javascript read json file 
Javascript :: disable copy past jquery 
Javascript :: This version of CLI is only compatible with Angular versions 0.0.0 || ^10.0.0-beta || =10.0.0 <11.0.0, but Angular version 9.1.3 was found instead. 
Javascript :: fibonacci sequence in javascript 
Javascript :: return a boolean if a number is divisible by 10 javascript 
Javascript :: discord.js mention regex 
Javascript :: jquery url change 
Javascript :: formdata appen array of strings 
Javascript :: check if element is on screen 
Javascript :: angular build with configuration 
Javascript :: how to call a javascript function in html without any event 
Javascript :: visual studio appsettings development json not nested appsettings.json 
Javascript :: reload app in react native 
Javascript :: jsconfig alias 
Javascript :: how to get today date in javascript 
Javascript :: javascript reverse array without modifying 
Javascript :: react/ionic ion-app undefined 
Javascript :: como pegar as propriedades css de um elemento :after html com js 
Javascript :: subtract 18 years from today javascript 
Javascript :: flexbox stretch height 
Javascript :: jquery to set value in select2 dropdown button 
Javascript :: codewars js Get the Middle Character 
Javascript :: sinha crud template 
Javascript :: react router add fallback to catch all 
Javascript :: React Navigation back() and goBack() not working 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =