Search code examples
phpjqueryphonegaphtml-framework-7

code not working on frmework 7 app


I am developing a cross platform app on framework 7 using php and mysql as back end technologies. I am retrieving data from mysql using ajax calls and this working on local server but when i put it in framework 7 its not working . Here is my code .

loaddata.php
<?php
$link=mysqli_connect("localhost","root","","vaistra");

if (mysqli_connect_errno())
    echo "Failed to connect to MySQL: " . mysqli_connect_error();

$action=$_POST["action"];
if($action=="showroom"){
    $query="SELECT * FROM dirf1";
    $show=mysqli_query($link,$query) or die ("Error");
    while($row=mysqli_fetch_array($show)){

?><tr><td><?php echo $row['dirName'] ?></td></tr><?php 
    }
}
?>

Here is the jquery code

index.html
<script type="text/javascript">
$(document).ready(function(){
    function showRoom(){
        $.ajax({
            type:"POST",
            url:"loaddata.php",
            data:{action:"showroom"},
            success:function(data){
                $("#content").html(data);
            }
        });
    }
    showRoom();
});
</script>

here is the consol log snapshot : enter image description here

So this code working fine outside framework7 but not working in framework7. Is there anything specific should do for framework7. Thanks


Solution

  • after changing jquery version it works