Advertisement
Guest User

BlackScorp

a guest
Jan 29th, 2010
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  var x = 0;
  2.             var y = 0;
  3.             var moveMap = function (y,x){
  4.                 $.ajax({
  5.                     type: "GET",
  6.                     url: "index.php",
  7.                     data: "y="+y+"&x="+x,
  8.                     success: function (htmlCode){
  9.                         $('body').html(htmlCode);
  10.                     }
  11.                 });
  12.             }
  13.             $(document).ready(function(){
  14.                 $('span.left').click(
  15.                 function(){
  16.                     x++;
  17.                     moveMap(y,x);
  18.                 });
  19.                 $('span.right').click(
  20.                 function(){
  21.                     x--;
  22.                     moveMap(y,x);
  23.                 });
  24.                 init();
  25.             });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement