a couple ideas.

1. add "var" so you're not creating a global variable (unrelated to your question, but a good practice, nonetheless):
        var anc_pv = $('.pv_act').attr("pv");

2. put another alert right after the var anc_pv = $ ('.pv_act').attr("pv");

        var anc_pv = $('.pv_act').attr("pv");
        alert(anc_pv);

What is alerted there? It could be that you don't actually have a "pv" attribute.


--Karl



On Aug 27, 2009, at 8:30 AM, Kilhom wrote:


Hi everyone !
My problem is simple.
Here is my code :

function ajax_test(){


        anc_pv = $('.pv_act').attr("pv");

        $.ajax({
          type: "GET",
          url: "ajax_test.php",
          data: "",
          dataType: "html",
          success: function(data){


                alert(anc_pv); // But it show "undefinided"

          }

        });
};

Any idea, someone ?
Thanks in advance ! Bye !

Reply via email to