In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-25 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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.