Linked Questions
33 questions linked to/from JavaScript: Setting location.href versus location
5
votes
3
answers
15k
views
Is there any difference between window.location and window.location.href? [duplicate]
Possible Duplicate:
Javascript: Setting window.location.href versus window.location
When I tested these code in browser it seems like they are the same. Is there any difference?
1
window.location = "...
0
votes
1
answer
6k
views
Best way change url location [duplicate]
I've found 5 different ways to change current location on a webpage. Which one's better and way are they all needed?
This is basically what I found:
window.location.assign("www.example.com")
does ...
0
votes
2
answers
1k
views
ajax success redirect not working [duplicate]
i have a ajax post from my form. when it succeed, i want to redirect to another web page..
What i have now:
$.ajax({
type : 'POST',
url : '/system/login.php',
data : ...
0
votes
0
answers
43
views
What is the difference between window.location.href and location.href? [duplicate]
what is the difference if I put window.location.href instead of location.href both of them seems to be returning the same value
307
votes
26
answers
617k
views
React-Router External link
Since I'm using React Router to handle my routes in a React app, I'm curious if there is a way to redirect to an external resource.
Say someone hits:
example.com/privacy-policy
I would like it to ...
327
votes
3
answers
413k
views
What's the difference between window.location= and window.location.replace()?
Is there a difference between these two lines?
var url = "http://www.google.com/";
window.location = url;
window.location.replace(url);
142
votes
8
answers
598k
views
Change URL and redirect using jQuery
I have some code like this,
<form id="abc">
<input type="text" id="txt" />
</form>
and now I want to redirect like this,
var temp = $("#txt").val();
url = "http://example.com/" +...
132
votes
5
answers
121k
views
Set window.location with TypeScript
I am getting an error with the following TypeScript code:
///<reference path='../../../Shared/typescript/jquery.d.ts' />
///<reference path='../../../Shared/typescript/jqueryStatic.d.ts' /&...
181
votes
3
answers
157k
views
window.location.href vs window.location.replace vs window.location.assign in JavaScript
What is the difference between
window.location.href="http://example.com";
window.location.replace("http://example.com");
window.location.assign("http://example.com");
I read in many forums that ...
131
votes
7
answers
79k
views
location.href property vs. location.assign() method
Is there any particular advantage/disadvantage in JavaScript memory consumption between using location.href = url as opposed to location.assign(url)?
I guess I'm wondering if it takes more memory to ...
67
votes
6
answers
66k
views
Difference between window.location and location.href
I am confused as to the difference between window.location and location.href. Both appear to be acting in the same way.
What is the difference?
33
votes
4
answers
33k
views
What is window.origin?
What is window.origin? It doesn't seem to be documented in the usual place.
It looks like it might be very similar to window.location.origin - for example, here on Stack Overflow, both return
https:/...
8
votes
1
answer
27k
views
How to Redirect Success or Failure Payment in Razorpay
I am New to Integrate Payment Gateway.
How to Redirect a URL after Success or Failure Payments in Razorpay. I want Js Code. I thing handler function can use that redirect. How to Use them
var ...
8
votes
1
answer
8k
views
Is there any difference with using only location vs using window.location across browsers
I find myself always writing:
console.log(window.location.href);
without even thinking about it. The majority of answers on SO also write it this way. Is there any reason why I can't just write:
...
2
votes
4
answers
11k
views
Make table row clickable
I have a table row that has background color on hover. When user clicks within the background color area, it should grab the link of the anchor tag inside the row and take the user there.. How do I do ...