Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to realize screens / views with JavaScript / Jquery easily?
    primarykey
    data
    text
    <p>I'm sure I'm missing something pretty basic, but I have just started to get myself up to speed on jQuery and Javascript programming. Previously I was doing server side programming with PHP. I'm now in the middle of creating a prototype for HTML5 webapp, where I would like to have different screens. Now with PHP that was pretty easy, I could just used server side templates like Smarty and be done with it.</p> <p>However to make my app more webapp like, I would like to dynamically change between screens without having to reload the window.</p> <p>I have looked into several options that might be anwsers to my question, but I'm not sure whether I'm on the right track.</p> <p>I have checked for example JsRender, JsViews or even the pure jquery load command. But what I'm not sure is whether these things would allow me to have something like this:</p> <p>HEADER_PART<br> MAIN_CONTENT<br> FOOTER_PART (also contains links to common JS files that I use)</p> <p>I would like to dynamically update the MAIN_CONTENT part. Currently my application is only one page, and all my custom logic that belongs to that page is in one JS file. In this JS file, I use a simple $(function() { ... to load my page, so whenever it gets loaded, parts of my page get updated asyncronously. This is fine, since all my blocks in this certain page would have to be loaded when that one page gets loaded.</p> <p>But what if I have a link, like main.html#otherscreen, and when I click that screen, I would like to change my MAIN_CONTENT and also run another page load specific JS that handles blocks on that other screen, not the first page?</p> <p>I know I could still use probably server side templating and load my pages using AJAX requrests, but again, not sure whether that is the right approach.</p> <p>Could you please enlighten me? :)</p> <p>Thanks &amp; best regards, Bence</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload