SyntaxFix
Write A Post
Hire A Developer
Questions
Why not just change the second line to
document.location.href="www.example.com/index.php?id=" + $(this).attr('id');