zoukankan      html  css  js  c++  java
  • Sencha touch 中的一段源码匿名中定义Function并调用

     1 /* 
     2  
     3 This file is part of Sencha Touch 2 
     4  
     5 Copyright (c) 2012 Sencha Inc 
     6  
     7 Contact:  http://www.sencha.com/contact 
     8  
     9 Commercial Usage 
    10 Licensees holding valid commercial licenses may use this file in accordance with the Commercial Software License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Sencha. 
    11  
    12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact. 
    13  
    14 */  
    15 (function() {  
    16     function write(content) {  
    17         document.write(content);  
    18     }  
    19   
    20     function meta(name, content) {  
    21         write('<meta name="' + name + '" content="' + content + '">');  
    22     }  
    23   
    24     var xhr = new XMLHttpRequest();  
    25     xhr.open('GET', 'app.json', false);  
    26     xhr.send(null);  
    27   
    28     var options = eval("(" + xhr.responseText + ")"),  
    29         scripts = options.js || [],  
    30         styleSheets = options.css || [],  
    31         i, ln, path;  
    32   
    33     meta('viewport', 'width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no');  
    34     meta('apple-mobile-web-app-capable', 'yes');  
    35     meta('apple-touch-fullscreen', 'yes');  
    36   
    37     for (i = 0,ln = styleSheets.length; i < ln; i++) {  
    38         path = styleSheets[i];  
    39   
    40         if (typeof path != 'string') {  
    41             path = path.path;  
    42         }  
    43   
    44         write('<link rel="stylesheet" href="'+path+'">');  
    45     }  
    46   
    47     for (i = 0,ln = scripts.length; i < ln; i++) {  
    48         path = scripts[i];  
    49   
    50         if (typeof path != 'string') {  
    51             path = path.path;  
    52         }  
    53   
    54         write('<script src="'+path+'"></'+'script>');  
    55     }  
    56   
    57 })();  
  • 相关阅读:
    input输入框与元素间有间隙
    显示3行,还要省略号(这个属性比较合适WebKit浏览器或移动端(绝大部分是WebKit内核的)浏览器)
    input file 修改按钮名称
    文本溢出处理
    移动WEB前端开发资源的一些素材
    带弹性的导航栏
    带重力的公告栏
    淘宝放大镜效果
    【规范】javascript 变量命名规则(转)
    常见的仿Flash图片轮播效果
  • 原文地址:https://www.cnblogs.com/laj12347/p/2962608.html
Copyright © 2011-2022 走看看