$load automatically loads the result of that request into the selected DIV, so in that case you wouldnt need a callback.

On 9/3/06, Rafael Santos < [EMAIL PROTECTED]> wrote:
Hey, i'd like to know why it happens..

The code:
$(document).ready( function(){   
$("#main").load("get_calcform.php",{ idref: iditem },
        function(txt){
            $("#main").html(txt);
        }
  );
$("#calculate").click( function(){
   alert('hi');
});

//output -> <form method="post"><//some inputs><input type='button' value='calculate' id='calculate'></form>

then nothing happens when Calculate is clicked...

Even if i change it (without form tag and submit button):
...
function(txt){
            $("#main").html(txt+"<a id='calculate'>calculate it</a>");
        }
...

But if i do .... $("#main").html(txt+"<a id='calculate' hmm it works')'>calculate it</a>"); .... IT WORKS..

Am i doing something wrong?



_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/



_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to