2
I need to use the Html5 appcache to store some web pages. Before using MVC I simply did this regular expression to check if you are connected or not.
var offlinePages = /^\/(index|about|schedule|location).htm$/;
And in this loop I take the test :
var hideLinksThatRequireOnline = function () {
var allNavLinks = document.querySelectorAll("nav.page-nav a");
for (var i = 0; i < allNavLinks.length; i++) {
var href = allNavLinks[i].getAttribute("href");
if (!offlinePages.test(href)) {
allNavLinks[i].style.display = "none";
}
}
};
So far so good , only now I will work with MVC , I will have Controlers and Actions, so I had to change the expression :
var offlinePages = /^\/(Index|About).htm$/;
I did not put Controller/Index , because when I put the bar, gave error in the regular expression. Only it didn’t work, someone has some idea of how to do ?
Thanks for the help, I got another question , how to save these views in the manifest file , I did : /home/index /home/about , only it didn’t work , I also tried to put views/home/index.cshtml only that it also wasn’t..
– Ricardo Mendes
/Home/Index and /Home/About should work. I suggest you create a new question for this problem by giving more information (for example, how is the rest of your manifest file? how you referenced it in html?).
– rla4