In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article is to share with you about what problems you will encounter in DWZ+ThinkPHP development. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
The details are as follows:
The thinkphp version I currently use is 3.1.3.
The J-UI dwz version seems to be 1.4.
When I encountered such a problem in the process of project development
When I perform the ajax operation in the background, success,error does not successfully return the prompt message, but returns an error message such as object object.
After studying for a long time, it is found that it is the problem of the version, and the newly revised ThinkPHP does not conform to the version of the Ajax technology in DWZ.
So I changed the ajaxReturn function in Action.class.php to
Protected function ajaxReturn ($data,$type='') {if (func_num_args () > 2) {/ / compatible prior to 3.0Use $args = func_get_args (); array_shift ($args); $info = array (); $info ['data'] = $data; $info [' info'] = array_shift ($args); $info ['status'] = array_shift ($args); $data = $info $type = $args?array_shift ($args):'';} / the addition to the original version-- $data ['statusCode'] = 1; / / $data [' navTabId'] = $_ REQUEST ['navTabId']; / / $data [' rel'] = $_ REQUEST ['rel']; / / $data [' callbackType'] = $_ REQUEST ['callbackType'] / / $data ['forwardUrl'] = $_ REQUEST [' forwardUrl']; / / $data ['confirmMsg'] = $_ REQUEST [' confirmMsg']; / / $data ['message'] = $data [' info']; / / 840206883@qq.com / / the addition to the original-/ / if (empty ($type)) $type = C ('DEFAULT_AJAX_RETURN') Exit (xml_encode ($data)); case 'JSONP': / / returns the JSON data format to the client containing status information header (' Content-Type:application/json; charset=utf-8'); $handler = isset ($_ get [C ('VAR_JSONP_HANDLER')])? $_ GET [C (' VAR_JSONP_HANDLER')]: C ('DEFAULT_JSONP_HANDLER') Exit ($handler.' ('.json _ encode ($data).'); case 'EVAL': / / returns the executable js script header (' Content-Type:text/html; charset=utf-8'); exit ($data); default: / / used to extend other returned format data tag ('ajax_return',$data);}} Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.