Mercurial > MadButterfly
changeset 1122:3d438daea48c
Add the handler for the next page
author | wycc |
---|---|
date | Thu, 09 Dec 2010 07:47:14 +0800 |
parents | e030c9d4b79b |
children | aad659b6b625 |
files | nodejs/examples/mce/epg.js |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/nodejs/examples/mce/epg.js Thu Dec 09 07:46:00 2010 +0800 +++ b/nodejs/examples/mce/epg.js Thu Dec 09 07:47:14 2010 +0800 @@ -28,7 +28,12 @@ js = js + data; }); res.on('end', function () { - res = JSON.parse(js); + try { + res = JSON.parse(js); + } catch(e) { + sys.puts(e); + sys.puts(js); + } sys.puts("parsed"); self.onLoad(res); @@ -119,7 +124,7 @@ fs.close(f); var fields = cachepath.split('.'); var ext = fields.pop(); - if (ext != "png") { + if (ext != "png" && ext != 'jpg') { fields.push("png"); newf = fields.join("."); sys.puts("cachepath="+cachepath+" newf="+newf);