diff nodejs/examples/mce/epg.js @ 1122:3d438daea48c

Add the handler for the next page
author wycc
date Thu, 09 Dec 2010 07:47:14 +0800
parents eb3719020866
children 9f3f20c4a4fb
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);