Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This is An Anonymous User, aka Anonymous. I'm here to deliver onto you codes that allow you to list your own movie on this site! Try to do this out of class, and feel free to create your own memes! Try and keep it PG-13; it may be a joke but it's also an educational joke. And make sure you wield this power responsibly!
- Quick reminders @ this code:
- Remember to set a unique _id element so that you don't overwrite others' items!
- // var id0 = {
- // "_id": ,
- // "story": ,
- // "buy": ,
- // "video1": ,
- // "thumb": ,
- // "video2": ,
- // "poster": ,
- // "advice": ,
- // "title": ,
- // "cast": ,
- // "director": ,
- // "genre": ,
- // "duration": ,
- // "release": ,
- // "availability": , };
- function getMovieData() {
- var request = new XMLHttpRequest(); // built-in function to enable web service call to send/receive data
- request.open('GET', movie_url, true);
- request.onload = function(){
- movie_array = JSON.parse(request.responseText);
- fetchComments();
- displayMovies(category);};
- request.send();
- }
- function postMovie(movieToPost)
- {
- var postMovie = new XMLHttpRequest(); //New Request instance to send comment
- postMovie.open("POST", movie_url, true); //Using Post to send data
- postMovie.setRequestHeader("Content-Type", "application/json");
- postMovie.send(JSON.stringify(movieToPost));
- postMovie.onload = function() {
- getMovieData();
- };
- //postMovie(id0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement