(self)
return u"""
            UE.ajax.request( '%(ajax_url)s', {
                 data: {
                     name: 'ueditor'
                 },
                 onsuccess: function ( xhr ) {%(ajax_success)s},
                 onerror: function ( xhr ){ %(ajax_error)s }
            });
        """ % {
            "ajax_url":self.ajax_url,
            "ajax_success":self.onExecuteAjaxCommand("success"),
            "ajax_error":self.onExecuteAjaxCommand("error")
        }
生成通过ajax调用后端命令的前端ajax代码
生成通过ajax调用后端命令的前端ajax代码
生成通过ajax调用后端命令的前端ajax代码
def render_ajax_command(self):
        """"生成通过ajax调用后端命令的前端ajax代码"""
        if not self.ajax_url: return ""

        return u"""
            UE.ajax.request( '%(ajax_url)s', {
                 data: {
                     name: 'ueditor'
                 },
                 onsuccess: function ( xhr ) {%(ajax_success)s},
                 onerror: function ( xhr ){ %(ajax_error)s }
            });
        """ % {
            "ajax_url":self.ajax_url,
            "ajax_success":self.onExecuteAjaxCommand("success"),
            "ajax_error":self.onExecuteAjaxCommand("error")
        }
def render_ajax_command ( self ) : if not self . ajax_url : return "" return u"""
            UE.ajax.request( '%(ajax_url)s', {
                 data: {
                     name: 'ueditor'
                 },
                 onsuccess: function ( xhr ) {%(ajax_success)s},
                 onerror: function ( xhr ){ %(ajax_error)s }
            });
        """ % { "ajax_url" : self . ajax_url , "ajax_success" : self . onExecuteAjaxCommand ( "success" ) , "ajax_error" : self . onExecuteAjaxCommand ( "error" ) }