Interactive website: push menu using notepad and chrome


#1

hi!
i've been trying to redo the push menu using notepad and chrome browser. the code was working perfectly when i tried it in codecademy. but when i tried it on notepad and chrome it didnt work. i just copied everything i did in codecademy. i made .html .js and . css files. the display is the same but there is no fa fa bars visible beside the menu and nothing happens when i clicked menu. is there anything i need to download for it to work outside codecademy. thanks!


#2

@machechilia
In your index.html file
in the <head></head> section
you will have to change

 <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">

into

<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">

AND
at the bottom of your <body></body> section
change

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

into

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

#3

Alternatively, run a server and access it through localhost.

A really simple way to do this if you have python installed is to navigate to the directory with the files and run python3 -m http.server or python2 -m SimpleHTTPServer

The problem is that the browser will look for the file with the same protocol as it got the html from, which is directly from the file system in your case. Specifying the protocol, or serving the website with http therefore fixes the problem.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.