Web development learning thread(Javascript, HTML, CSS, angular, vue.js).


Login or Register to Reply

 
Thread Tools Search this Thread
# 8  
You could also do location="whatever"; which might avoid confusion with the generic string operator .replace() which works very differently, doing substitutions inside a string.
This User Gave Thanks to Corona688 For This Post:
# 9  
I generally use location='' like Corona688 suggested and not location.replace(). You might also consider location.href='' which tend to use as well.

The main difference between location.href and location.replace() is that replace() removes the URL of the current document from the document history, so then it is not possible to use the "back" button to navigate back to the original document. There are reasons for this method as well.

If you want to erase the prior location history, then consider location.replace()
These 2 Users Gave Thanks to Neo For This Post:
# 10  
Ravinder, you can also think about it like this:

window.location.href = '' simulates a mouse click

window.location.replace() simulates an HTTP redirect

Hope this helps.
This User Gave Thanks to Neo For This Post:
# 11  
Quote:
Originally Posted by Corona688
You could also do location="whatever"; which might avoid confusion with the generic string operator .replace() which works very differently, doing substitutions inside a string.
Hey Corona688,

You might want to consider some modern Javascript or Bootstrap CSS framework (any you like) to spruce up your old site:

Code:
http://burningsmell.org/

Don't you think that site needs a refresh?
# 12  
Quote:
Originally Posted by Neo
I generally use location='' like Corona688 suggested and not location.replace(). You might also consider location.href='' which tend to use as well.
The main difference between location.href and location.replace() is that replace() removes the URL of the current document from the document history, so then it is not possible to use the "back" button to navigate back to the original document. There are reasons for this method as well.
Thanks Corona688 and Neo.
Quote:
If you want to erase the prior location history, then consider location.replace()
May be bank's net banking sites use it? Just a guess here, usually in my initial days of using net banking I used to do click on back while having an active session in net banking sites, it used to log me out or gives some error(can't remember exact error).

Thanks,
R. Singh

Last edited by RavinderSingh13; 04-17-2019 at 07:43 AM..
# 13  
Yes, many sites like banks and other web apps do not want a user clicking on the back button and using that page (for a number of reasons), so in that case, .replace() is often the best.
# 14  
Quote:
Originally Posted by Neo
Hey Corona688,

You might want to consider some modern Javascript or Bootstrap CSS framework (any you like) to spruce up your old site
The CSS could use work, but I don't have much use for javascript on a static site.
This User Gave Thanks to Corona688 For This Post:
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Google Trends: react.js angular.js vue.js
Neo
While I'm on the subject of Google trends, here is a global trend since 2004 comparing react.js, angular.js, vue.js It's no secret I'm a vue.js fan and coder, but not because of the trend line (which I just saw for the first time a few minutes ago) My experience is that vue.js, a late arrival...... Web Development
0
Web Development
Simple Vue.js Component to Redirect to External Web Page Using Vue Router
Neo
Vue Router has some quirks and on of the quirks is that it is not reliable when adding external links using the vue-router library. After struggling with many solutions, I have found that creating a simple Vue.js component like this one seems to work the best (so far): Component Example: ...... Web Development
0
Web Development
HTML down, CSS help, ahhhh
N-Training
I am having some problems. I have been able to learn HTML, but when I try and encode CSS, nothing happens, what is the major issue here. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>MY CSS</title> <style...... Web Development
7
Web Development
Learning HTML
N-Training
I have tried to create a web page browser window. An example, I copied what the book pretty much wanted but get only the header. What should I change? Also Anyone know any good books for this? Many thanks. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Translation/EN" ...... Web Development
4
Web Development