khamsat khamsat khamsat

SPA

a Single Page Application is a web application that interacts with the user by dynamically rewriting the current page rather than loading entire new pages from a server

Only by specifying some properties will you be able to create a Single Page Application Without much effort with the efficiency and performance of the application There is not much to know about SPA on all you have to know how to create it and some rules Which you should consider

define a Required attribute

There is required attributes within <a> tag that tells the frameworks if this is SPA
attr : fn-spa


<div myView></div>
<a href="about.php" fn-spa="myView" >about</a>
    

This current page with SPA if you notice that you are moving from page to page without reloading the page

The title and address also changes

Note :

don't forget to set fn-spa attribute or will not work as SPA


<a href="about.php" fn-spa="myView" >about</a>
    <!-- will work -->  
<a href="about.php"  >about</a>
<!-- will not work as SPA -->  
    

fn-before

used to do something before request page (functions , etc ....)

fn-progress

used to do something while page on progress (functions , etc ....)

fn-after

used to do something after page load (functions , etc ....)


<div id="content"  myView fn-before="before" fn-after="after" ></div>
<a href="about.php" fn-spa="myView">About Us</a>
<script type="text/javascript">
   function before(){
      // do something here
    }
function progress(){
      // do something here
    }
function after(){
      // do something here
    }
</script>
    
khamsat khamsat khamsat khamsat