Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 10th, 2012  |  syntax: jQuery  |  size: 0.60 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. });