Here's some background of what i am trying to do:
Ok, i am building an iPhone web app. Originally i was building it as one single page (index.php) with each "page" of the site being a <div>
element and all of the contents of that page would sit inside the <div>
. I originally wanted to create the app this way as one way to utilize JQTouch.
The problem:
Everything works by just using SELECT queries in php to pull data respectively for each "page" (actually a <div>
element) of the site. The problem is that i have one section that displays a list of items that are pulled from the database by the SELECT query statement. It displays on the "page" only the title and image for each row pulled from the database. Then, when you click on one of the items it takes you to a new "page" (again, just a different <div>
within the index.php page) that shows more details about that specific list item. The problem is that i couldn't figure out how to get the content to pull dynamically based on what list item you click on.
The Solution: My solution to this and a couple other issues is to go ahead and split out the "pages" into actual physical pages (index.php, about.php, etc..). I would then use Ajax calls out to these pages to pull the content off of them into the web app. (this is so i can make it a web app and not just a mobile website) This is what i am thinking about doing to fix the above problem. I will dump the database data into an xml file. Then for the anchor links for each list item i will pass variables in the string. Then when the details page loads it will see the variables from the url string and parse the xml to retrieve the correct data based on those variables. It will then populate the page data with the information retrieved from the xml.
Am i on the right track? Or am i way off? Haha, this is my first attempt at a web app. I'm a fast learner but it's the initial learning i'm having issues with. Any help or advice to point me in the right direction would be greatly appreciated! I know there isn't a whole lot of detail here so please if you have any questions feel free to fire away. And please let me know if this post needs editing or i need to add any information or anything. Thanks in advance for any help!