mvvm - knockoutJS + master page/view -


doubt possible don't have 1 page app, pretty every view make contains 80% of same css/javascript, there way tell knockoutjs master view else populate?

i doubt pretty 1 page app for... best can hope use combres combine non-changing stuff 1 resource file per type...

== edit ==

adding example of mean, pretty sure wouldn't able inject multiple areas shown below, here example:

<!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html>     <head>         <title>master page</title>         <link type="text/css" rel="stylesheet" href="../assets/styles/main.css">         <link type="text/css" rel="stylesheet" href="../assets/styles/themes/simple.css">         <link type="text/css" rel="stylesheet" href="../assets/styles/jquery.qtip.min.css">         {per page css here}     </head>     <body>         {per page content here}          <script type="text/javascript" src="../scripts/libs/jquery-1.6.1.min.js"></script>         <script type="text/javascript" src="../scripts/libs/jquery-ui-1.8.13.custom.min.js"></script>         <script type="text/javascript" src="../scripts/libs/jquery.validate.min.js"></script>         <script type="text/javascript" src="../scripts/libs/jquery.tmpl.js"></script>         <script type="text/javascript" src="../scripts/libs/jquery.qtip.pack.js"></script>         <script type="text/javascript" src="../scripts/libs/knockout-1.2.1.js"></script>         <script type="text/javascript" src="../scripts/libs/knockout-external-templates.js"></script>         <script type="text/javascript" src="../scripts/libs/cufon-yui.js"></script>          {per page scripts here}     </body> </html>  <!-- view 1 --> <link type="text/css" rel="stylesheet" href="../assets/styles/views/view1.css"> <h1>some content</h1> <script type="text/javascript" src="../scripts/view1.js"></script>  <!-- view 2 --> <link type="text/css" rel="stylesheet" href="../assets/styles/views/view2.css"> <h1>some other content</h1> <script type="text/javascript" src="../scripts/view2.js"></script> 

again, if cannot not game breaker, dont want have update every view if update jquery version etc...

you declare javascript code relevant each view in views , common code in master page. call bit of code master page , bind them using ko.applybindings.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -