Sasha Grievus
Sasha Grievus

Reputation: 2686

Jquery mobile limit to role page?

I'm developing my first application in jqm. I have a unique index.php containing a lot of blocks of code like this

<div data-role="page" id="scheda7">
  <div data-role="header" class="ui-bar-b">
    <h1><?php $qry_nomeScheda7 = "select * from nomeScheda where id='7'"; $rs_nomeScheda7 = connetti($qry_nomeScheda7); $valore7 = mysql_fetch_array($rs_nomeScheda7); echo $valore7[nomeScheda];
       ?></h1>
  </div>
       <?php include 'scheda7.php'; ?>
       <?php include 'footer.php'; ?>
</div>

one for each page of my application.

For each page I have a separate schedaN.php containing its own html and javascript. Now what happens to me is that some page load correctly, while others remain stuck to the loading (the spin wheel keep turn and turning). The pages not loading are not ever the same... Maybe I only move a page up or down in the index and it begin to work or stop to. So I was guessing: I noticed that pages seems to work while they are less than seven... There's some limit to the number of data role page you can include in a application??

Upvotes: 1

Views: 621

Answers (2)

Sasha Grievus
Sasha Grievus

Reputation: 2686

Problem solved! There was some html line that was not supposed to be there. The interesting part is that the page containing the error (a div left unclosed) was correctly loaded, while the next was not. So i learned that when there's no javascript or php error is a good idea to use some validation tool of html. In this specific case, i used http://validator.w3.org/#validate_by_uri+with_options to validate html and got where the error was. Thank you all and hope this is useful to someone.

Upvotes: 0

Taifun
Taifun

Reputation: 6293

Instead of doing multiple database queries like this one,

<?php $qry_nomeScheda7 = "select * from nomeScheda where id='7'"; $rs_nomeScheda7 = connetti($qry_nomeScheda7); $valore7 = mysql_fetch_array($rs_nomeScheda7); echo $valore7[nomeScheda];?>

I'd suggest to execute only one database query which fetches all the info you need. This should save execution time and probably solve your problem.

Upvotes: 1

Related Questions