1 | var editor; |
这种参数必须在$(document) 里面调用不能直接调
Every day to be a little better
1 | var editor; |
这种参数必须在$(document) 里面调用不能直接调
普通授权 用wx.authorize 就可以了有相关文档 可以直接用
https://developers.weixin.qq.com/miniprogram/dev/api/authorize.html
但是用户信息授权被坑爹的小程序改成了只能用button调起
1 | <button open-type="getUserInfo" bindgetuserinfo="userInfoHandler"> Click me </button> |
用以下代码去判断用户是否授权了
1 | userInfoHandler: function (e) { |
后台只能获取到当前用户信息 并获取不到其他用户信息!!!!坑爹!!! 只能暂存
1.css方法: 兼容性一般 不兼容safari
1 | input[type=checkbox] |
html
1 | <%= check_box_tag 'email[bcc_to_self]', true, |
//listen for the show event on any triggered elements
$(‘[data-toggle=”tooltip”]’).on(‘show.bs.tooltip’, function() {
$(this).click();
});
button 可以
a tag 不行
a tag 带data-confirm 可以
//判断是否需要提示更新App
if (connectionError) {
// NSLog(@"connectionError->%@", connectionError.localizedDescription);
return ;
}
NSError *error;
NSDictionary *resultsDict = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:&error];
if (error) {
// NSLog(@"error->%@", error.localizedDescription);
return;
}
NSArray *sourceArray = resultsDict[@"results"];
if (sourceArray.count >= 1) {
//AppStore内最新App的版本号
NSDictionary *sourceDict = sourceArray[0];
NSString *newVersion = sourceDict[@"version"];
if ([self judgeNewVersion:newVersion withOldVersion:appVersion])
{
UIAlertController *alertVc = [UIAlertController alertControllerWithTitle:@"提示:\n您的App不是最新版本,请问是否更新" message:@"" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"暂不更新" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
// [alertVc dismissViewControllerAnimated:YES completion:nil];
}];
[alertVc addAction:action1];
UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"去更新" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
//跳转到AppStore,该App下载界面
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:sourceDict[@"trackViewUrl"]]];
}];
[alertVc addAction:action2];
[[UIApplication sharedApplication].delegate.window.rootViewController presentViewController:alertVc animated:YES completion:nil];
}
}
}];return NO;
}if ([newArray[i] integerValue] > [oldArray[i] integerValue]) {
return YES;
} else if ([newArray[i] integerValue] < [oldArray[i] integerValue]) {
return NO;
} else { }
}在 didFinishLaunchingWithOptions方法中调用就可以了
window.alert = function(name){
var iframe = document.createElement(“IFRAME”);
iframe.style.display=”none”;
iframe.setAttribute(“src”, ‘data:text/plain,’);
document.documentElement.appendChild(iframe);
window.frames[0].window.alert(name);
iframe.parentNode.removeChild(iframe);
};
window.confirm = (message) ->
iframe = document.createElement(‘IFRAME’)
iframe.style.display = ‘none’
iframe.setAttribute ‘src’, ‘data:text/plain,’
document.documentElement.appendChild iframe
alertFrame = window.frames[0]
result = alertFrame.window.confirm(message)
iframe.parentNode.removeChild iframe
result