// added a line end to make it easier to read on here
echo "<li><a href='#' onclick=\\"History.pushState({state:null},'article,$id','article');
return false;\\">".$row['title']."</a> </li>";
Oh the joys of writing js inside php … Try that instead, if it does not work try looking at the source code of the page.
I’d test this out on a single new test page till the complexity is worked out.
Then repeat using the heredoc syntax for strings - you might find that easier to work with when outputing js.