I am completely new to the world of express and node, so please be patient with me :D
In my index.ejs file, I have a string that I need to pass to my viewActivity.ejs file. This string will be utilized in the JavaScript section of my viewActivity.ejs file. I am unsure of the correct approach to achieve this. Is it even possible to pass the string directly from one view to another, or do I need to involve another file?
Below is my code. I aim to pass the "stringToPass" to another view when a button is clicked.
function getPosts() {
var query = new Parse.Query(Post);
query.find({
success: function(results){
for (var i in results) {
var title = results[i].get("activityTitle");
var stringToPass = results[i].id
}
}, error: function(error) {
console.log("Query Error:"+error.message);
}
});
}