Dustin L Dustin L - 2 months ago 11
Javascript Question

$document.ready not triggering - Hosted on BlueHost

I am currently having trouble with a web application I am building for captive portal. I have all PHP and HTML parts of this application functioning. I have tried multiple function outside of the IF statement to check and see if the jQuery was running at all but it appears to be non functional.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js">
</script>
<script type="text/javascript">
$(document).ready(function(){
if(<?php echo $_POST['submit'];?> = Continue){
$("#form1").hide(3s);
$("#form2").show(3s);

};
alert('Hello world');
});

</script>


As you can see the script is supposed to hide the first form, and show a second after the first form has run (it submits the information to the same page) by checking to see if submit has been posted. I apologize if this ends up being a very specific issue but I have spent the last 3 days and about 14 hours attempting to solve this issue, and have frankly run out of options.

Answer
 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js">
 </script>    

<script>
$(document).ready(function(){
var x = '<?php echo "continue"; ?>';
if(x== "Continue"){
        $("#form1").hide(3000);
        $("#form2").show(3000);

    }
else
{
    alert();
}
    alert(x);
});
</script>

Hope it helps you out.