No; it's a rock-and-hard place problem.
Javascript runs on the client, so can't write text files on the server; while for security reasons it can't read or write files on the client.
There are ways of making PHP pages search-engine friendly. There are a couple of articles on exactly this subject on this site.