I have in my Document Ready:
$(document).ready(function () {
showAll();
var av= $('#a').attr('value');
alert(av); <-----**Debugging Value**
if(av == 1) {
alert("1")
} else {
alert("0")
}
});
The function showAll() calls a PHP and directly generates hidden inputs.
<input type='hidden' value='///automatically generated 1 or 0///'>
My probelm right now is when I alert av at the Debugging Value, it is undefined. And I know this is because that section is not live. How can I make that section live automatically.
If i used live(‘click’, etc etc….) then that works, but I am trying to make it load based on the conditional.
Thanks for your help.
EDIT:///
My showProf looks like this:
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("id_verified").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","showProf.php?i="+myi+"&t=" + Math.random(),true);
xmlhttp.send();
You can do a callback from your ajax call like
From http://api.jquery.com/jQuery.ajax/