[RESOLVED] Is creating page contents dynamically using javascript faster than loading different pages

I'm designing a website with different pages and every page has it's contents as like as `textbox, label, button, gridview` and etc.
after that I want to load every pages using `$("#xx").load(page url Address)` in jquery to prevent postback when the page is necessary.

is this method faster or following method:

I have just one page for example: `default.aspx` and a `javascript` file.
The page contents will be created using javascript dynamically just in one page  with `createElement` instead of loading different pages.

In the first method all `aspx` elements should be converted to `html` and then html elements must be transferred to the client but in the second method we won't have any `html` element transferring except for the `default.aspx` page and the elements will create in run-time using javascript.

"Faster" is not an easy term to define in this case as you're really not comparing similar things. It depends upon many factors, such as how many controls (both in aspx and html), what the data is, where it comes from, and so on.

There is definitely a trend towards more responsive, script driven sites using html and templating (eg jQuery, backbone, knockout, etc). The advantage of these is that only data travels across the wire, but the backend still has to process that data (eg send/update from database), so your backend still needs that logic. ASP.NET MVC makes building that architecture easier, but still doesn't sully support single-page applications, so you'd have to build all the logic yourself.

thoughts on "[RESOLVED] Is creating page contents dynamically using javascript faster than loading different pages "

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>