I am a very visual programmer/designer, and I developed a mini-framework for my projects for displaying data from PHP output.
Basically I design my page and desginate div
and li
blocks to be looped and displayed using my IDE, Dreamweaver. I simply do a string replace routine on the target div
/li
elements using Javascript to generate the content. I guess you can say my design visually is the template itself. It's so much easier to do changes: before, I'd design it then copy and paste the HTML code for the block to be looped into PHP, and there I do the value filling.
So basically my PHP script outputs an object and my Javascript function does the magic and generates (appends to an element) as needed..
This has worked perfectly until I started handling huge amounts of table data (around 2000 rows). I notice the browser pausing for a bit while it tries to generate the content, and that's on a desktop - I'd imagine how much slower it can be when my page is ran on a mobile device.
This got me thinking, should i go back to generating content in the backend and do a simple output on the JS/browser side? I liked manipulating rows of data in JS already, and it's much more visually convenient to keep all the template code on the page, as is, where is, and have Javascript just pick it up and use it to generate content. I'd hate going back to having PHP generate the actual html code.
What would you recommend in this situation?
P.S.: For those who want to suggest cutting down data limiting display: in this case I can't. I have to show all returned rows without paginations. I have my reasons/requirements.