Guest User

Untitled

a guest
Aug 10th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function(){
  2.     $('#menu-topo a').live('click', function(e) {
  3.         e.preventDefault()
  4.        
  5.         setTimeout(function(){
  6.             //valor do link
  7.             valor = $(this).attr('name');  
  8.             //requisição ajax
  9.             $.ajax({
  10.                 type: 'POST', //tipo de req.
  11.                 url: 'cabecalho.php', //arquivo alvo
  12.                 data: 'valorTeste='+valor, //dados a serem passados.
  13.                 //pegando a resposta da requisição com a variável 'resposta'
  14.                 success: function(resposta){
  15.                 $('body').html(resposta);
  16.                 }          
  17.             });            
  18.         },1);
  19.  
  20.         setTimeout(function(){
  21.             $('#conteudo').load($(this).attr('href'));
  22.         },1);
  23.     });
  24. });
Advertisement
Add Comment
Please, Sign In to add comment