Giter Site home page Giter Site logo

movies's People

Contributors

yasershomaf avatar

Watchers

 avatar

movies's Issues

Don't use alert

They can be disabled and they are not very user-friendly. Just display a warning like you do with the 'no results found' message.

Awesome!!!

You made a very awesome use of the extra parameters pageIndex! Dynamically looking for the next set of pages is great!

arrayToUnique.js

  • Syntax: Put spaces between operators i < 0 instead of i<0 and i === ii instead of i===ii.
  • Unnecessary condition. The first if is not needed, if length is 0 it would loop 0 times. You could have put a check in like (Array.isArray(arr) or arr == null)
  • Most important: you are modifying the array you are looping over. It would be better to make a new array where you push the results into or make a shallow copy (arr.slice())

Using innerHtml

Sometimes text nodes are created, sometimes innerHtml is set. Be consistent, and just append text nodes.

General style

  • Don't put all code in one giant function, this is hard to read. Try to seperate these things into multiple functions: one that handles the request, one that creating of the main content, one that handles creating each sub element being created etc.

    Edit: You did that actually but since they are all contained in a big function (which is not necessarily bad) but it's quite hard to read and too much is happening so the overview is hard. Putting comments between your code, commenting your functions would help a lot. Also seperate statements which belong together logically together, and then place a newline.

  • file.js is a very non-descriptive file name. It tells us nothing about what it wants to do, and basically everything on your comuter is a file.

  • You are referencing variables from your script in your HTML. This is not needed at all. You could better make seperate functions (one which sets the last page) and then calls the request function.

  • The arrows on your HTML page are not very descriptives of what they do. Normally it's two types, one that goes to the end and one that goes one page further. I had to click them to really figure them out ^^

Going to next page takes current (changed) value

When I go to the next word but accidentally changed the content of the search bar while not wanting to search for it it takes the new value.

You could have stored the current 'query' in the document, just as you do with currentpages etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.