Guest User

Untitled

a guest
Jul 17th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. <!doctype html>
  2. <html lang="en" class="no-js">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6. <title></title>
  7. <meta name="description" content="">
  8. <meta name="author" content="">
  9. </head>
  10. <!--[if lt IE 7 ]> <body class="ie6"> <![endif]-->
  11. <!--[if IE 7 ]> <body class="ie7"> <![endif]-->
  12. <!--[if IE 8 ]> <body class="ie8"> <![endif]-->
  13. <!--[if IE 9 ]> <body class="ie9"> <![endif]-->
  14. <!--[if (gt IE 9)|!(IE)]><!--> <body> <!--<![endif]-->
  15.  
  16. <div id="container">
  17. <header>
  18.  
  19. </header>
  20.  
  21. <div id="main">
  22. <ul id="listofobjects"></ul>
  23. </div>
  24.  
  25. <footer>
  26.  
  27. </footer>
  28. </div>
  29.  
  30. <script>
  31. (function(){
  32.  
  33. function list_return(return_values) {
  34. console.log('list_return', this, arguments);
  35.  
  36. var myObject, current, l = return_values.length;
  37.  
  38. for (var i = 0; i < l; i++) {
  39. current = return_values[i];
  40. console.log(current);
  41.  
  42. myObject = JSON.parse(current.object);
  43.  
  44. console.log(current.okey);
  45. console.log(myObject);
  46.  
  47. add_li('listofobjects', current.okey + ' ' + myObject.firstName + ' ' + myObject.lastName)
  48. }
  49.  
  50. document.body.removeChild(document.getElementById("TMP2"));
  51. }
  52.  
  53. function add_li(list, text) {
  54. var list = document.getElementById(list);
  55. var li = document.createElement("li");
  56. li.innerHTML = text;
  57. list.appendChild(li);
  58. }
  59.  
  60. function list() {
  61. var script = document.createElement('script');
  62. script.src = "index.php?callback=list_return";
  63. script.id = "TMP2";
  64. document.body.appendChild(script);
  65. }
  66.  
  67. // Globalify...
  68. this.list = list;
  69. this.list_return = list_return;
  70.  
  71. })();
  72. </script>
  73.  
  74. </body>
  75. </html>
Add Comment
Please, Sign In to add comment