Advertisement
xapu

Untitled

Aug 6th, 2017
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. function publishAd (elems) {
  2. let publisher = sessionStorage.getItem('userName')
  3. let title = elems[0].value
  4. let description = elems[1].value
  5. let dateOfPublishing = elems[2].value
  6. let img = elems[3].value|'http://lorempixel.com/400/200/'
  7. let price = elems[4].value
  8. let views = 0
  9.  
  10. $.ajax({
  11. url: baas + 'appdata/'+appKey+'/advertisement',
  12. method:'POST',
  13. headers: headerMaker('kinvey'),
  14. data: JSON.stringify({
  15. views,
  16. price,
  17. dateOfPublishing,
  18. publisher,
  19. description,
  20. title,
  21. img
  22. }),
  23. success:()=>successDisplay(),
  24. error:(e)=>console.log(e)
  25. })
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement