Thursday, September 30, 2010

让Google Chrome模拟各种手机浏览器


  • 谷歌Android:
    [cc lang='text' ]google-chrome --user-agent="Mozilla/5.0 (Linux; U; Android 2.2; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"[/cc]

  • 苹果iPhone:
    [cc lang='text' ]google-chrome --user-agent="Mozilla/5.0 (iPad; U; CPU OS 3_2_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B500 Safari/531.21.10"[/cc]

  • 诺基亚N97:
    [cc lang='text' ]google-chrome --user-agent="Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-1/20.0.019; Profile/MIDP-2.1 Configuration/CLDC-1.1) AppleWebKit/525 (KHTML, like Gecko) BrowserNG/7.1.18124"[/cc]

Tuesday, September 28, 2010

Python类例子

[cc lang="python"]class Message:
def __init__(self, aString):
self.text = aString
def printIt(self):
print self.text

m1 = Message("Hello world")
m2 = Message("So long, it was short but sweet")

note = [m1, m2] # put the objects in a list
for msg in note:
msg.printIt() # print each message in turn
[/cc]

详细指南

新手指导:jQuery提交表单

[cc lang="javascript"]