Tuesday, 15 September 2015

php - onclick="$.post(this.href); return false;" not working right -


Javascript / jQuery Nobhere. I'm trying to post a href but without reloading the page

Reading around the Internet, I see should To be able to add a onclick = "$. Post (this.href); return false;" on Href, but it is not working for me and the page is reloading.

This looks like mourning in my PHP code:

echo "& lt; a href = '" $ url "Post = $ post_ID 'onclick = \" $ .post (this.href);

The reason for any suggestion is that the page is refreshing when clicking on that href

Lucky guess here, jquery is not loaded :)

On this Based on my best estimate that jQuery has not been loaded

No comments:

Post a Comment