2007年05月15日 星期二 17:17
²âÊÔ´úÂëÈëÏ£º htmlÎļþÖеÄajax´úÂ룺 $("#testAj").click( function(){ $.get("testaj.html", {data: "mmmm"}, function(msg){ alert(msg); } ) } £© djangoµÄviewÖеĴúÂ룺 def testaj(request): return HttpResponse(simplejson.dumps({"text": "mmmm", "mm": "dddd"}), mimetype='application/javascript') ÓÐÁ½¸öÎÊÌ⣺ 1.ÈçºÎ°Ñ$.getÌæ»»³É$.post¾Í²»Äܵ¯³ö¶Ô»°¿òÁË£¬¿´jqueryµÄÎĵµÀgetºÍpost¶¼¿ÉÒÔajaxµÄ¡£ 2.alert(msg) ¿ÉÒÔÏÔʾ×Ö·û´®"{"text": "mmmm", "mm": "dddd"}"£¬µ«ÊÇÈç¹û¸Ä³Éalert(msg.mm )»òalert(msg[0])ÏÔʾΪ¿Õ£¬ÎÒ¿´ÍøÉϵÄһЩ½Ì³Ì°üÀ¨limodouµÄ¡¶step¡·½Ì³Ì¶¼ÊÇÕâÑùдµÄ£¬ÎªÊ²Ã´ÕâÀï²»ÐУ¿Èç¹ûд³Éalert(eval( msg.mm)[0])¾Í²»Äܵ¯³ö¶Ô»°¿ò£¬ÎªÊ²Ã´ÄØ£¿ -- http://www.flyaflya.com -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070515/77077754/attachment.htm
2007年05月15日 星期二 17:22
ÄãÍøÕ¾ÉϵÄÓÎÏ·Ôõô²»ÌṩԴÂë°¡£¿ ÔÚ07-5-15£¬flyaflya <flyaflya在gmail.com> дµÀ£º > > ²âÊÔ´úÂëÈëÏ£º > htmlÎļþÖеÄajax´úÂ룺 > $("#testAj").click( > function(){ > $.get("testaj.html", {data: "mmmm"}, > function(msg){ > alert(msg); > } > ) > } > £© > > djangoµÄviewÖеĴúÂ룺 > def testaj(request): > return HttpResponse(simplejson.dumps({"text": "mmmm", "mm": "dddd"}), > mimetype='application/javascript') > > ÓÐÁ½¸öÎÊÌ⣺ > 1.ÈçºÎ°Ñ$.getÌæ»»³É$.post¾Í²»Äܵ¯³ö¶Ô»°¿òÁË£¬¿´jqueryµÄÎĵµÀgetºÍpost¶¼¿ÉÒÔajaxµÄ¡£ > 2.alert(msg) ¿ÉÒÔÏÔʾ×Ö·û´®"{"text": "mmmm", "mm": "dddd"}"£¬µ«ÊÇÈç¹û¸Ä³Éalert(msg.mm)»òalert(msg[0])ÏÔʾΪ¿Õ£¬ÎÒ¿´ÍøÉϵÄһЩ½Ì³Ì°üÀ¨limodouµÄ¡¶step¡·½Ì³Ì¶¼ÊÇÕâÑùдµÄ£¬ÎªÊ²Ã´ÕâÀï²»ÐУ¿Èç¹ûд³Éalert(eval( > msg.mm)[0])¾Í²»Äܵ¯³ö¶Ô»°¿ò£¬ÎªÊ²Ã´ÄØ£¿ > > -- > http://www.flyaflya.com > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070515/db097ea8/attachment.html
2007年05月15日 星期二 17:28
»¹²»ÄÜÌṩԴÂ룬Ҫ¿¿Ëü׬ЩÁãÓÃÇ®¡£ On 5/15/07, Í·Ì«ÔÎ <torrycn在gmail.com> wrote: > > ÄãÍøÕ¾ÉϵÄÓÎÏ·Ôõô²»ÌṩԴÂë°¡£¿ > > ÔÚ07-5-15£¬flyaflya <flyaflya在gmail.com> дµÀ£º > > > > ²âÊÔ´úÂëÈëÏ£º > > htmlÎļþÖеÄajax´úÂ룺 > > $("#testAj").click( > > function(){ > > $.get("testaj.html", {data: "mmmm"}, > > function(msg){ > > alert(msg); > > } > > ) > > } > > £© > > > > djangoµÄviewÖеĴúÂ룺 > > def testaj(request): > > return HttpResponse(simplejson.dumps({"text": "mmmm", "mm": > > "dddd"}), mimetype='application/javascript') > > > > ÓÐÁ½¸öÎÊÌ⣺ > > 1.ÈçºÎ°Ñ$.getÌæ»»³É$.post¾Í²»Äܵ¯³ö¶Ô»°¿òÁË£¬¿´jqueryµÄÎĵµÀgetºÍpost¶¼¿ÉÒÔajaxµÄ¡£ > > 2.alert(msg) ¿ÉÒÔÏÔʾ×Ö·û´®"{"text": "mmmm", "mm": "dddd"}"£¬µ«ÊÇÈç¹û¸Ä³Éalert(msg.mm > > )»òalert(msg[0])ÏÔʾΪ¿Õ£¬ÎÒ¿´ÍøÉϵÄһЩ½Ì³Ì°üÀ¨limodouµÄ¡¶step¡·½Ì³Ì¶¼ÊÇÕâÑùдµÄ£¬ÎªÊ²Ã´ÕâÀï²»ÐУ¿Èç¹ûд³Éalert(eval( > > msg.mm)[0])¾Í²»Äܵ¯³ö¶Ô»°¿ò£¬ÎªÊ²Ã´ÄØ£¿ > > > > -- > > http://www.flyaflya.com > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -- http://www.flyaflya.com -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070515/51d43fce/attachment.htm
2007年05月15日 星期二 17:55
不至于吧。。。找些项目做做不是更好? ----- Original Message ----- From: flyaflya To: python-chinese at lists.python.cn Sent: Tuesday, May 15, 2007 5:28 PM Subject: Re: [python-chinese]关于JQuery ajax的两点疑问. 还不能提供源码,要靠它赚些零用钱。 On 5/15/07, 头太晕 <torrycn at gmail.com> wrote: 你网站上的游戏怎么不提供源码啊? 在07-5-15,flyaflya <flyaflya at gmail.com> 写道: 测试代码入下: html文件中的ajax代码: $("#testAj").click( function(){ $.get("testaj.html", {data: "mmmm"}, function(msg){ alert(msg); } ) } ) django的view中的代码: def testaj(request): return HttpResponse(simplejson.dumps({"text": "mmmm", "mm": "dddd"}), mimetype='application/javascript') 有两个问题: 1.如何把$.get替换成$.post就不能弹出对话框了,看jquery的文档里,get和post都可以ajax的。 2.alert(msg) 可以显示字符串"{"text": "mmmm", "mm": "dddd"}",但是如果改成alert(msg.mm )或alert(msg[0])显示为空,我看网上的一些教程包括limodou的《step》教程都是这样写的,为什么这里不行?如果写成alert(eval( msg.mm)[0])就不能弹出对话框,为什么呢? -- http://www.flyaflya.com _______________________________________________ python-chinese Post: send python-chinese at lists.python.cn Subscribe: send subscribe to python-chinese-request at lists.python.cn Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn Detail Info: http://python.cn/mailman/listinfo/python-chinese _______________________________________________ python-chinese Post: send python-chinese at lists.python.cn Subscribe: send subscribe to python-chinese-request at lists.python.cn Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn Detail Info: http://python.cn/mailman/listinfo/python-chinese -- http://www.flyaflya.com ------------------------------------------------------------------------------ _______________________________________________ python-chinese Post: send python-chinese at lists.python.cn Subscribe: send subscribe to python-chinese-request at lists.python.cn Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn Detail Info: http://python.cn/mailman/listinfo/python-chinese -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20070515/fc6a5a51/attachment-0001.html
2007年05月15日 星期二 18:12
ÓÃpythonдµÄ£¿ On 5/15/07, flyaflya <flyaflya在gmail.com> wrote: > > »¹²»ÄÜÌṩԴÂ룬Ҫ¿¿Ëü׬ЩÁãÓÃÇ®¡£ > > On 5/15/07, Í·Ì«ÔÎ <torrycn在gmail.com> wrote: > > > > ÄãÍøÕ¾ÉϵÄÓÎÏ·Ôõô²»ÌṩԴÂë°¡£¿ > > > > ÔÚ07-5-15£¬flyaflya <flyaflya在gmail.com> дµÀ£º > > > > > > ²âÊÔ´úÂëÈëÏ£º > > > htmlÎļþÖеÄajax´úÂ룺 > > > $("#testAj").click( > > > function(){ > > > $.get("testaj.html", {data: "mmmm"}, > > > function(msg){ > > > alert(msg); > > > } > > > ) > > > } > > > £© > > > > > > djangoµÄviewÖеĴúÂ룺 > > > def testaj(request): > > > return HttpResponse(simplejson.dumps({"text": "mmmm", "mm": > > > "dddd"}), mimetype='application/javascript') > > > > > > ÓÐÁ½¸öÎÊÌ⣺ > > > 1.ÈçºÎ°Ñ$.getÌæ»»³É$.post¾Í²»Äܵ¯³ö¶Ô»°¿òÁË£¬¿´jqueryµÄÎĵµÀgetºÍpost¶¼¿ÉÒÔajaxµÄ¡£ > > > 2.alert(msg) ¿ÉÒÔÏÔʾ×Ö·û´®"{"text": "mmmm", "mm": "dddd"}"£¬µ«ÊÇÈç¹û¸Ä³Éalert(msg.mm > > > )»òalert(msg[0])ÏÔʾΪ¿Õ£¬ÎÒ¿´ÍøÉϵÄһЩ½Ì³Ì°üÀ¨limodouµÄ¡¶step¡·½Ì³Ì¶¼ÊÇÕâÑùдµÄ£¬ÎªÊ²Ã´ÕâÀï²»ÐУ¿Èç¹ûд³Éalert(eval( > > > msg.mm)[0])¾Í²»Äܵ¯³ö¶Ô»°¿ò£¬ÎªÊ²Ã´ÄØ£¿ > > > > > > -- > > > http://www.flyaflya.com > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese在lists.python.cn > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > -- > http://www.flyaflya.com > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070515/d3fb0dfc/attachment.htm
2007年05月16日 星期三 12:42
Ó¦¸ÃÊÇalert(eval( msg <http://msg.mm/>).mm)°É, ÄãÍøÕ¾ÉϵÄÓÎÏ·²»´íŶ,ÓÃʲô¶«Î÷¿ª·¢µÄ°¡? On 5/15/07, Tian <askfor在gmail.com> wrote: > > ÓÃpythonдµÄ£¿ > > On 5/15/07, flyaflya <flyaflya在gmail.com> wrote: > > > > »¹²»ÄÜÌṩԴÂ룬Ҫ¿¿Ëü׬ЩÁãÓÃÇ®¡£ > > > > On 5/15/07, Í·Ì«ÔÎ <torrycn在gmail.com> wrote: > > > > > > ÄãÍøÕ¾ÉϵÄÓÎÏ·Ôõô²»ÌṩԴÂë°¡£¿ > > > > > > ÔÚ07-5-15£¬flyaflya <flyaflya在gmail.com> дµÀ£º > > > > > > > > ²âÊÔ´úÂëÈëÏ£º > > > > htmlÎļþÖеÄajax´úÂ룺 > > > > $("#testAj").click( > > > > function(){ > > > > $.get("testaj.html", {data: "mmmm"}, > > > > function(msg){ > > > > alert(msg); > > > > } > > > > ) > > > > } > > > > £© > > > > > > > > djangoµÄviewÖеĴúÂ룺 > > > > def testaj(request): > > > > return HttpResponse(simplejson.dumps({"text": "mmmm", "mm": > > > > "dddd"}), mimetype='application/javascript') > > > > > > > > ÓÐÁ½¸öÎÊÌ⣺ > > > > 1.ÈçºÎ°Ñ$.getÌæ»»³É$.post¾Í²»Äܵ¯³ö¶Ô»°¿òÁË£¬¿´jqueryµÄÎĵµÀgetºÍpost¶¼¿ÉÒÔajaxµÄ¡£ > > > > 2.alert(msg) ¿ÉÒÔÏÔʾ×Ö·û´®"{"text": "mmmm", "mm": "dddd"}"£¬µ«ÊÇÈç¹û¸Ä³Éalert(msg.mm > > > > )»òalert(msg[0])ÏÔʾΪ¿Õ£¬ÎÒ¿´ÍøÉϵÄһЩ½Ì³Ì°üÀ¨limodouµÄ¡¶step¡·½Ì³Ì¶¼ÊÇÕâÑùдµÄ£¬ÎªÊ²Ã´ÕâÀï²»ÐУ¿Èç¹ûд³Éalert(eval( > > > > msg.mm)[0])¾Í²»Äܵ¯³ö¶Ô»°¿ò£¬ÎªÊ²Ã´ÄØ£¿ > > > > > > > > -- > > > > http://www.flyaflya.com > > > > > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese在lists.python.cn > > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > > > > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese在lists.python.cn > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > Unsubscribe: send unsubscribe to > > > python-chinese-request在lists.python.cn > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > -- > > http://www.flyaflya.com > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -- python c# and opensource blog:http://www.chyni.cn -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070516/530ab6ff/attachment-0001.html
2007年05月16日 星期三 12:45
On 5/16/07, 追风逐月 <chinesexu在gmail.com> wrote: > 应该是alert(eval( msg).mm)吧, > 你网站上的游戏不错哦,用什么东西开发的啊? > 只eval可能是不行的,要前后加'(',')' -- I like python! UliPad <>: http://wiki.woodpecker.org.cn/moin/UliPad My Blog: http://www.donews.net/limodou
2007年05月17日 星期四 08:36
追风逐月 写道: > 应该是alert(eval( msg <http://msg.mm/>).mm)吧, > 你网站上的游戏不错哦,用什么东西开发的啊? PyGame 做的吧。。。美术很赞啊。。还听到了轩辕剑配乐 :-)
2007年05月17日 星期四 17:24
·¢ÏÖÁËÎÊÌâµÄËùÔÚ£¬Ö»Òª¼ÓÉϵÚËĸö²ÎÊý"json"Ò»ÇÐÎÊÌâ¾Í½â¾öÁË£¬ÎĵµÀïÕâÁ½¸öº¯ÊýÖ»ÓÐÈý¸ö²ÎÊý£¬¿´Ô´ÂëʵÊÂÉÏÓеÚËĸö²ÎÊý¡£ On 5/17/07, Kasicass <kasicass在gmail.com> wrote: > > ×··çÖðÔ дµÀ: > > Ó¦¸ÃÊÇalert(eval( msg <http://msg.mm/>).mm)°É, > > ÄãÍøÕ¾ÉϵÄÓÎÏ·²»´íŶ,ÓÃʲô¶«Î÷¿ª·¢µÄ°¡? > > PyGame ×öµÄ°É¡£¡£¡£ÃÀÊõºÜÔÞ°¡¡£¡£»¹Ìýµ½ÁËÐùÔ¯½£ÅäÀÖ :-) > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese -- http://www.flyaflya.com -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070517/b262726c/attachment.html
2007年05月17日 星期四 17:26
ÊÇpygame×÷µÄ£¬»¹ÓÐÒ»µãÒÉÎÊÊÇevalÒ»¸ödictʱΪʲôҪ¼Ó"()" On 5/17/07, flyaflya <flyaflya在gmail.com> wrote: > > ·¢ÏÖÁËÎÊÌâµÄËùÔÚ£¬Ö»Òª¼ÓÉϵÚËĸö²ÎÊý"json"Ò»ÇÐÎÊÌâ¾Í½â¾öÁË£¬ÎĵµÀïÕâÁ½¸öº¯ÊýÖ»ÓÐÈý¸ö²ÎÊý£¬¿´Ô´ÂëʵÊÂÉÏÓеÚËĸö²ÎÊý¡£ > > On 5/17/07, Kasicass <kasicass在gmail.com > wrote: > > > > ×··çÖðÔ дµÀ: > > > Ó¦¸ÃÊÇalert(eval( msg <http://msg.mm/ >).mm)°É, > > > ÄãÍøÕ¾ÉϵÄÓÎÏ·²»´íŶ,ÓÃʲô¶«Î÷¿ª·¢µÄ°¡? > > > > PyGame ×öµÄ°É¡£¡£¡£ÃÀÊõºÜÔÞ°¡¡£¡£»¹Ìýµ½ÁËÐùÔ¯½£ÅäÀÖ :-) > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > -- > http://www.flyaflya.com -- http://www.flyaflya.com -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070517/ede022c5/attachment.html
Zeuux © 2025
京ICP备05028076号