Title says it all. Basically I am looking to retrieve the end of the url using jQuery to add one to the selection and go to that page. I had some help from someone else on her but I want to understand how it is working/ why it's not working:
var urlFrags = window.location.href.replace(".html", "").split("_"),
curPage = parseInt(urlFrags[urlFrags.length]),
nextPage = "example_" + (curPage + 1) + ".html";
It could be an error somewhere else, but I am working down the line trying to bug-fix it. I understand pretty much everything going on, except I don't understand parseInt() and stuff.
Would it be possible to '.getAsIntiger(urlFrags)' ? (I have tried this but I may have implemented wrong.)
parseInt()will turn a String into an Integer. If for example you have the string "Text1"*, it will turn into 1. With that 1 you can perform mathematical equetions. *it strips out all the text that cannot be turned into a number. Parameters and more at developer.mozilla.org/de/docs/Web/JavaScript/Reference/…"example_" + (parseInt("example_3.html".replace("example_","").replace(".html","")) + 1) + ".html"