Hello
I have a while loop that displays my blog posts.
{
echo $row['blog-title'];
echo $row['author'];
}
I am trying to implement a peice of javascript where whenever a user clicks on the blog post, it displays an alert containing the post.
I could easily add the js code inline into the while loop like this
alert("<? echo $row['blog']; ?>");
However due to technical reasons, I have to add the js code in a separate file outside the loop.
My question is how can I retrieve the blog data outside of the loop, and attach it to each result?