English 中文(简体)
Web2py ajax :eval 行动不会恢复超文本功能
原标题:Web2py ajax :eval action is not returning HTML functions
  • 时间:2012-05-16 09:42:52
  •  标签:
  • ajax
  • web2py

In my ajax function call am using target :eval to do some actions from controller. And my controller function returns value with web2py HTML functions def ajaxmessage(): return "jQuery( #divAjaxTest ).html(%s);" % repr(H1( ajax message )) #not returning any value.

But if it is just a text with repr() then it is returning fine. return "jQuery( #divAjaxTest ).html(%s);" % repr( ajax message ). #this is working fine

I am new to web2py, may be it is a small problem. Please let me know how to solve this. Thanks in advance.

最佳回答

The first one should return a value, but the generated string would be something like:

jQuery( #divAjaxTest ).html(<gluon.html.H1 object at 0x153ccd0>)

def ajaxmessage():
    return "jQuery( #divAjaxTest ).html( %s );" % H1( ajax message ).xml()
问题回答

暂无回答




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...

热门标签