Advertisement
Guest User

So You Want To Be A Master Memer

a guest
Nov 21st, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. 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!
  2.  
  3. Quick reminders @ this code:
  4. Remember to set a unique _id element so that you don't overwrite others' items!
  5.  
  6. // var id0 = {
  7. // "_id": ,
  8. // "story": ,
  9. // "buy": ,
  10. // "video1": ,
  11. // "thumb": ,
  12. // "video2": ,
  13. // "poster": ,
  14. // "advice": ,
  15. // "title": ,
  16. // "cast": ,
  17. // "director": ,
  18. // "genre": ,
  19. // "duration": ,
  20. // "release": ,
  21. // "availability": , };
  22.  
  23. function getMovieData() {
  24. var request = new XMLHttpRequest(); // built-in function to enable web service call to send/receive data
  25. request.open('GET', movie_url, true);
  26.  
  27. request.onload = function(){
  28. movie_array = JSON.parse(request.responseText);
  29. fetchComments();
  30. displayMovies(category);};
  31. request.send();
  32. }
  33.  
  34. function postMovie(movieToPost)
  35. {
  36. var postMovie = new XMLHttpRequest(); //New Request instance to send comment
  37.  
  38. postMovie.open("POST", movie_url, true); //Using Post to send data
  39.  
  40. postMovie.setRequestHeader("Content-Type", "application/json");
  41. postMovie.send(JSON.stringify(movieToPost));
  42. postMovie.onload = function() {
  43. getMovieData();
  44. };
  45.  
  46. //postMovie(id0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement