Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html lang="en" class="no-js">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <title></title>
- <meta name="description" content="">
- <meta name="author" content="">
- </head>
- <!--[if lt IE 7 ]> <body class="ie6"> <![endif]-->
- <!--[if IE 7 ]> <body class="ie7"> <![endif]-->
- <!--[if IE 8 ]> <body class="ie8"> <![endif]-->
- <!--[if IE 9 ]> <body class="ie9"> <![endif]-->
- <!--[if (gt IE 9)|!(IE)]><!--> <body> <!--<![endif]-->
- <div id="container">
- <header>
- </header>
- <div id="main">
- <ul id="listofobjects"></ul>
- </div>
- <footer>
- </footer>
- </div>
- <script>
- (function(){
- function list_return(return_values) {
- console.log('list_return', this, arguments);
- var myObject, current, l = return_values.length;
- for (var i = 0; i < l; i++) {
- current = return_values[i];
- console.log(current);
- myObject = JSON.parse(current.object);
- console.log(current.okey);
- console.log(myObject);
- add_li('listofobjects', current.okey + ' ' + myObject.firstName + ' ' + myObject.lastName)
- }
- document.body.removeChild(document.getElementById("TMP2"));
- }
- function add_li(list, text) {
- var list = document.getElementById(list);
- var li = document.createElement("li");
- li.innerHTML = text;
- list.appendChild(li);
- }
- function list() {
- var script = document.createElement('script');
- script.src = "index.php?callback=list_return";
- script.id = "TMP2";
- document.body.appendChild(script);
- }
- // Globalify...
- this.list = list;
- this.list_return = list_return;
- })();
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment