gsg-g7 / discover-countries Goto Github PK
View Code? Open in Web Editor NEWAutocomplete website - Discover Countries
Home Page: https://discover-countries.herokuapp.com/
Autocomplete website - Discover Countries
Home Page: https://discover-countries.herokuapp.com/
Install the dotenv module and make the port hidden
1
include the extension name.index.class.js
we need the last part in the split.path.extname(the file path)
Make the slide down menu for the countries headings
-send xhr request
Make a test for the functions and make sure the code is not having any error messages with the Eslint code style
Discover-Countries/src/handlers/handleStatics.js
Lines 17 to 20 in 33e8c4e
code
in error object then send not found, the error may be from the server when reading the file or the path for directory not for the file there is a lot of situations.
{ Error: ENOENT: no such file or directory, open '****the file path***'
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '****the file path***' }
Hi,
Your code is good, but if you handle the other response status that would be better
if ( xhr.readyState === 4){
if ( xhr.status === 200){
}else if( ...){
}else{...}
Discover-Countries/src/router.js
Line 17 in 33e8c4e
just put it in the description of the project
Discover-Countries/public/js/script.js
Line 16 in 33e8c4e
Use descriptive yet relatively short names (based on the name) for your variables.
E.g. handleD
would be handleApi
Discover-Countries/public/js/dom.js
Line 12 in 33e8c4e
setTimeout
.setTimeout
because of the speed of the internet and another issues.why some of your issues are empty.
you must put a description to your issues to understand what these issues do
really good job for all :)
Discover-Countries/public/js/script.js
Lines 4 to 7 in 33e8c4e
Write down things about the project
Hi again :),
I have a note, I guess the backtick notation not required here if you use the variable country directly without backtick, it will work.
Discover-Countries/public/js/dom.js
Line 39 in 33e8c4e
Discover-Countries/public/js/dom.js
Line 19 in 33e8c4e
Discover-Countries/public/js/dom.js
Line 36 in 33e8c4e
document.querySelector('.main__results')
in variable and call itDiscover-Countries/src/handlers/index.js
Lines 1 to 4 in 33e8c4e
require
for all handler files?require
the handlers files directly in router.js
instead of export
it then require
then export
then require
.Create Server.js for the node
your file is 1.5mb
and u send it every key down every .8s, yes good job on this one, it greatly helped the server
but it gets pretty messy
imagine someone with 200kb/s using the website
it would take 7s to receive the file at that point, is that even autocomplete at this point?
BUT nevermind this, u dont have to change anything, but i had to point this out, so u imagine what unwanted effects this approach has
my suggestions, would be that u either send the file once, or handle the request in the server and send the user the name of the countries only, and when he clicks on a country, u make another request for that country cities
create router.js for the node .
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.