Advertisement
undefined0000

Halp

Mar 16th, 2012
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. include('dbcon.php');
  3. ?>
  4. <html>
  5.     <head>
  6.         <script>
  7.         var nextId;
  8. function getNextId(){
  9.  
  10. var xmlHttp;
  11.     try{   
  12.         xmlHttp=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari
  13.     }
  14.     catch (e){
  15.         try{
  16.             xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
  17.         }
  18.         catch (e){
  19.             try{
  20.                 xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  21.             }
  22.             catch (e){
  23.                 alert("No AJAX!?");
  24.                 return false;
  25.             }
  26.         }
  27.     }
  28.  
  29. xmlHttp.onreadystatechange=function(){
  30.     if(xmlHttp.readyState==4){
  31.         nextId= xmlHttp.responseText;
  32.         var out = xmlHttp.responseText;
  33.     }
  34. }
  35. xmlHttp.open("GET","getTable.php",true);
  36. xmlHttp.send(null);
  37. }
  38.  
  39. var dragging = false;
  40. var thiz = null;
  41.             function setDrag(element) {
  42.                
  43.                 thiz = document.getElementById(element);
  44.                 dragging = true;
  45.             }
  46.             function stopDrag() {
  47.                 dragging = false;
  48.                
  49.             }
  50.             function doDrag() {
  51.             if(dragging) {
  52.             thiz.style.left = event.clientX;
  53.             thiz.style.top = event.clientY;
  54. }
  55. }
  56.  
  57. function spawnTable(type) {
  58.     switch(type) {
  59.         case "4top":
  60.         getNextId();
  61.         break;
  62.     }
  63. }  
  64.  
  65.         </script>
  66.     </head>
  67.  
  68.     <body onmouseup="stopDrag();" onmousemove="doDrag();">
  69.     <div id="holder" name=""></div>
  70.         <div style="position: absolute; left:20px; width: 25px; height: 25px; background-color: #0099CC; overflow: none;" onmousedown="spawnTable('4top');" id="4top" onmouseup="stopDrag();">This is a div</div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement