hash # url – single page website navigation

function hashChecker(){
    var hash = (window.location.hash).replace('#', '');
    if (hash.length == 0) {
        //no hash do something   
    } else {   
        //else do something with hash
      if (window.location.hash == "#hashname") {
      // do something

Install ReactJs on Codeanywhere

The way I did:

  • Log in to https://codeanywhere.com
  • Create a blank container by clicking File > New Connection > Container
  • Choose “Blank Development Stack” Ubuntu OS
  • It will open two tabs
  • Copy Container related information somewhere.  This information will have web address. This is the address you’ll need to view your application.
  • Go to terminal (this should be first opened tab)
sudo apt-get update
sudo apt install curl
curl -sL https://deb.nodesource.com/setup_10.x | sudo bash - 
sudo apt-get install nodejs
sudo apt-get install npm 
sudo npm install -g create-react-app 
create-react-app my-react-app 
cd my-react-app 
npm start

You’ll see http://localhost:3000 in your terminal. Ignore that. Use the web address you have copied before.

Happy coding!