Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('dbcon.php');
- ?>
- <html>
- <head>
- <script>
- var nextId;
- function getNextId(){
- var xmlHttp;
- try{
- xmlHttp=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari
- }
- catch (e){
- try{
- xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
- }
- catch (e){
- try{
- xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
- }
- catch (e){
- alert("No AJAX!?");
- return false;
- }
- }
- }
- xmlHttp.onreadystatechange=function(){
- if(xmlHttp.readyState==4){
- nextId= xmlHttp.responseText;
- var out = xmlHttp.responseText;
- }
- }
- xmlHttp.open("GET","getTable.php",true);
- xmlHttp.send(null);
- }
- var dragging = false;
- var thiz = null;
- function setDrag(element) {
- thiz = document.getElementById(element);
- dragging = true;
- }
- function stopDrag() {
- dragging = false;
- }
- function doDrag() {
- if(dragging) {
- thiz.style.left = event.clientX;
- thiz.style.top = event.clientY;
- }
- }
- function spawnTable(type) {
- switch(type) {
- case "4top":
- getNextId();
- break;
- }
- }
- </script>
- </head>
- <body onmouseup="stopDrag();" onmousemove="doDrag();">
- <div id="holder" name=""></div>
- <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