Transaction with JQuery

Transaction with JQuery

Hello to all!!

I use the following code with jquery to realize the load of content of other pages of my web in a div. Well then, from links of out of the div, it works without problems, but when I want to load a link of inside the div, recharges the entire page, instead of only the div... And, in addition, it me does not execute the codes js of the pages loaded in the div. Some solution? Here I leave the code you:

  1. <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
    var emi = "#nav a"; //Emisor
    var rec = "#show"; //Receptor
    var src = "../imagenes/cargando.gif"; //Imageen de precarga
    var iid = "loading"; //Id de la precarga
    var pre = '<img src="'+src+'"id="'+iid+'"/>'; //Objeto precarga
    var spe = "slow"; //Velocidad del efecto
    $(emi).each(function(){
        var href = $(this).attr("href"); //Guardamos el vaolor de href de cada enlace.
        $(this).click(function(){ //Cargamos en rec el contenido de cada href y le damos efectos.
            $(rec).hide().after(pre).load(href, function(){
                $("#"+iid).remove();$(this).fadeIn(spe)
                });
                return false; //Para que no se redireccione.
        });
    });
    });
    </script>
    </head>
    <body>
    <div id="nav">
    <ul>
       <li><a href="ejem1.php?vari=1">Enlace Uno</a></li>
       <li><a href="ejem1.php?vari=0">Enlace Dos</a></li>
       <li><a href="ejem2.php?vari=1">Otro link</a></li>
       <li><a href="1337.htm">1337</a></li>
       <li><a href="creacionismo.htm">0.o?</a></li>
    </ul>
    <div id="show"></div>
    </div> 































Thank you very much!