小编max*_*182的帖子

Pdf.js无法在Internet Explorer上运行

任何人都可以解释为什么这段代码在IE中不起作用?在Chrome中一切正常.

我的部分HTML:

<head>
<script type='text/javascript' src="//code.jquery.com/jquery-1.9.1.js"></script>
<script type='text/javascript' src="http://vivin.net/pub/pdfjs/pdf.js"></script>
<script type='text/javascript' src="http://vivin.net/pub/pdfjs/textlayerbuilder.js"</script>
</head>  
<body>
<div id="pdfContainer" class = "pdf-content"></div>
</body>
Run Code Online (Sandbox Code Playgroud)

适用于Chrome的完整代码和示例:http://jsfiddle.net/vivin/RjqUf/

html javascript html5 internet-explorer

7
推荐指数
1
解决办法
9717
查看次数

UIKeyboardTypeDecimalPad检测它是否有逗号","或点"."

如何检查UIKeyboardTypeDecimalPad是否有点/逗号?我需要这个来检查输入了多少点/逗号,所以我可以将它们限制为1.我知道当我知道UIKeyboardTypeDecimalPad有逗号时如何做到这一点.

-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {

NSCharacterSet *cs;
NSString *filtered;

NSString *newString = [textField.text stringByReplacingCharactersInRange:range withString:string];

if ([textField.text rangeOfString:@","].location == NSNotFound) {

    cs = [[NSCharacterSet characterSetWithCharactersInString:NUMBERSPERIOD] invertedSet];
    filtered = [[string componentsSeparatedByCharactersInSet:cs] componentsJoinedByString:@""];
    return [string isEqualToString:filtered];
 }


else {

    cs = [[NSCharacterSet characterSetWithCharactersInString:NUMBERS] invertedSet];
    filtered = [[string componentsSeparatedByCharactersInSet:cs] componentsJoinedByString:@""];     

    NSUInteger count = 0, length = [newString length];
    NSRange range = NSMakeRange(0, length); 
    while(range.location != NSNotFound)
    {
        range = [newString rangeOfString: @"," options:0 range:range];
        if(range.location != NSNotFound)
        {
            range = NSMakeRange(range.location …
Run Code Online (Sandbox Code Playgroud)

iphone xcode uikeyboard ios

2
推荐指数
1
解决办法
1276
查看次数

标签 统计

html ×1

html5 ×1

internet-explorer ×1

ios ×1

iphone ×1

javascript ×1

uikeyboard ×1

xcode ×1