问:ios开发下使用什么命令能退出iphone应用?0+

656 views / 2011.05.29 / 11:11 下午

There is no API provided for gracefully terminating an iPhone application. Under the iPhone OS, the user presses the Home button to close applications. Should your application have conditions in which it cannot provide its intended function, the recommended approach is to display an alert for the user that indicates the nature of the problem and possible actions the user could take – turning on WiFi, enabling Location Services, etc. Allow the user to terminate the application at their own discretion.

WARNING: It is possible to quit the application by calling exit. Applications calling exit will appear to the user to have crashed, rather than performing a graceful termination and animating back to the Home screen. Such usage provides a negative experience and is strongly discouraged.

Categories: 分享 Tags:

Discuz7.2 IE9兼容性–杜工完全修补方案0+

1,598 views / 2011.04.22 / 6:06 下午
现象:
1. IE9快速发帖不跳转
2. IE9管理员处理帖子失败
3. IE9登录不跳转,需要手动刷新
原因:
1. AJAXPOST函数判断out了
2. 动态创建iframe时各浏览器处理方式不同
解决方法:
1. 修改templates/header.htm
替换为
2.修改include/js/common.js
把ajaxpost函数替换为:
function ajaxpost(formid, showid, waitid, showidclass, submitbtn, recall) {
 var waitid = typeof waitid == 'undefined' || waitid === null ? showid : (waitid !== '' ? waitid : '');
 var showidclass = !showidclass ? '' : showidclass;
 var ajaxframeid = 'ajaxframe';
 var ajaxframe = $(ajaxframeid);
 var formtarget = $(formid).target;
 
var handleResult = function() {
 var s = '';
 var evaled = false;
 
showloading('none');
 try {
 s = $(ajaxframeid).contentWindow.document.XMLDocument.text;
 } catch(e) {
 try {
 s = $(ajaxframeid).contentWindow.document.documentElement.firstChild.wholeText;
 } catch(e) {
 try {
 s = $(ajaxframeid).contentWindow.document.documentElement.firstChild.nodeValue;
 } catch(e) {
 s = '内部错误,无法显示此内容';
 }
 }
 }
 
if(s != '' && s.indexOf('ajaxerror') != -1) {
 evalscript(s);
 evaled = true;
 }
 if(showidclass) {
 $(showid).className = showidclass;
 if(submitbtn) {
 submitbtn.disabled = false;
 }
 }
 if(!evaled && (typeof ajaxerror == 'undefined' || !ajaxerror)) {
 ajaxinnerhtml($(showid), s);
 }
 ajaxerror = null;
 if($(formid)) $(formid).target = formtarget;
 if(typeof recall == 'function') {
 recall();
 } else {
 eval(recall);
 }
 if(!evaled) evalscript(s);
 ajaxframe.loading = 0;
 $('append_parent').removeChild(ajaxframe);
 };
 if(!ajaxframe) {
 try{
 ajaxframe = document.createElement('<iframe name="' + ajaxframeid + '" id="' + ajaxframeid + '"></iframe>');
 }catch(e){
 ajaxframe = document.createElement('iframe');
 ajaxframe.name = ajaxframeid;
 ajaxframe.id = ajaxframeid;
 }
 ajaxframe.style.display = 'none';
 ajaxframe.loading = 1;
 $('append_parent').appendChild(ajaxframe);
 } else if(ajaxframe.loading) {
 return false;
 }
 
_attachEvent(ajaxframe, 'load', handleResult);
 
showloading();
 $(formid).target = ajaxframeid;
 $(formid).action += '&inajax=1';
 $(formid).submit();
 return false;
}
后台刷新缓存,搞定。
Categories: 感悟 Tags: ,

CentOS或者redhad下用yum或者rpm安装了 mysql 及 mysql-server , 在编译安装php时用 –with-mysql 选项出现错误

Note that the MySQL client library is not bundled anymore.

首先使用命令find / -name ‘mysql.h’ 查找路径,如果找到就给with-mysql=赋上路径,如果找不到,那就是缺少了 mysql-devel 安装包,用yum或者rpm安装上,即可解决问题

Categories: 感悟 Tags: ,

推荐本站使用的免备案高性价比美国VPS0+

556 views / 2011.03.30 / 5:05 下午

近来总是有朋友询问购买服务器是事情,又担心备案周期长,很是恼火。杜工正好推荐本站长期使用的VPS–DiaHosting。
DiaHosting旨在为广大中国站长提供自主管理的美国优质VPS,所有VPS均采用Xen虚拟技术,保证了VPS的质量,同时也是国内首家提供Xen-Shell管理平台的VPS供应商,加上二次开发的重装系统功能,Xen-Shell完全可以满足用户需求,本站使用的VPS就是一款拥有最高管理权限完全自主的产品。
大家可以看下DiaHosting的数据中心,顺便选个适合自己的线路:

洛杉矶数据中心

100MB 下载速度测试
测试IP: 67.215.238.117

拉斯维加斯数据中心

50MB 下载速度测试
测试IP: 208.64.24.6

西雅图SoftLayer数据中心

100MB 下载速度测试
测试IP: 67.228.118.21

达拉斯SoftLayer数据中心

100MB 下载速度测试
测试IP: 66.228.118.51

温馨提示,这家支持优惠码的哦。

最新优惠码 (二选一):

优惠码: 10%OFF 终身10%优惠

优惠码: FREEDA 适用于X360或X360以上型号, 免费DirectAdmin控制面板

预付优惠:

季付即可获得额外 5% 的折扣
半年付即可获得额外 10% 的折扣
年付即可获得额外 15% 的折扣

推荐理由:中文客服/支持中文支付/中国访问速度很好/口碑不错/性价比高

购买地址:链接>>

Categories: 感悟 Tags:

GFW测试,很有意思0+

941 views / 2011.03.15 / 5:05 下午

和大仙煌煌搞dns测试,在国外服务器写了个返回dig信息的服务:
http://96.44.137.95/test/dnsTest.php?url=baidu.com
可返回正确结果

http://96.44.137.95/test/dnsTest.php?url=facebook.com
可返回正确结果

http://96.44.137.95/test/dnsTest.php?url=www.facebook.com
哈哈,看看出现什么现象了?

具体原因不讨论,不解释。

Categories: 感悟 Tags: ,