I have a new project I am working on that involves fetching a webpage, (using PHP and cURL) parsing the HTML and javascript out of it and then handling the data in the resul
All these answers seem to presume that there is no possibility of php JavaScript emulation, but there is a near-fully-compliant open-source php JavaScript emulator here:
http://www.sitepoint.com/blogs/2006/01/19/j4p5-javascript-for-php5/
Combined with Env.js, you could get pretty close to a full server-side js execution solution.