I'm building a Blog with Html/Css/JQuery and I've hit a wall.
I want to load a different Blog Post based on the Number passed in from the link beforehand. For example, if I have 3 Posts, load content based on which number is selected.
This is in content.js.
var prepareContent = function (postNumber) {
readTextFile(postNumber);
};
However, I have no clue how to manipulate postNumber when click is called in another .js file.
This is in index.js.
$("#post0").click(function () {
conentPassed = 0;
window.location = "content.html";
});
$("#post1").click(function () {
contentPassed = 1;
window.location = "content.html";
});
I would like to "pass" a variable into content.js from index.js. Is there any way to do this? Thank you.