`
zuroc
  • 浏览: 1290257 次
  • 性别: Icon_minigender_1
  • 来自: 江苏
社区版块
存档分类
最新评论

google reader 的 prompt 函数

阅读更多

IE7对prompt做了限制,MS的产品部门真是好奇怪....

我抄了一下google reader的prompt实现

function ie7(){
return (document.all?true:false)&&!("contains" in document)&&!window.opera&&("XMLHttpRequest" in window);
}


function raw_input(a,b){
b=b||'';
a={_message:a,_initialValue:b,_newValue:null}
if(ie7()){
    window.showModalDialog(
        "/reader/ui/3744973097-zh-CN-prompt?hl=zh-CN",a,
       "dialogHeight:140px;dialogWidth:400px;scroll:no;status:no;unadorned:yes"
    );
    return a._newValue
}else return window.prompt(a,b)
};

/reader/ui/3744973097-zh-CN-prompt?hl=zh-CN 的代码

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><title>Google 阅读器</title>
<style type="text/css">
    html, body {
      margin: 0;
      font-size: 90%;    
      background: #fff;
      color: #000;
    }
   
    body {
      padding: 1em;
    }
   
    html, body, input {
      font-family: arial, sans-serif;
    }  
   
    #input {
      width: 100%;
    }
   
    #buttons {
      text-align: right;
    }
   
    #buttons input {
      width: 7em;
    }
  </style>
<script type="text/javascript">
    function initPrompt() {
      var args = window.dialogArguments;
     
      var messageNode = document.getElementById("message");
      messageNode.innerHTML = args._message;
     
      var inputNode = document.getElementById("input");
      inputNode.value = args._initialValue;
    }
   
    function handleCancel() {
      window.dialogArguments._newValue = null;
     
      window.close();
    }
   
    function handleSubmit() {
      window.dialogArguments._newValue = document.getElementById("input").value;
     
      window.close();
     
      return false;
    }
  </script></head>
<body onload="initPrompt()"><form onsubmit="return handleSubmit()" action=""><p id="message"></p>
<p><input type="text" id="input"></p>
<p id="buttons"><input type="submit" value="确定">
<input type="button" onclick="handleCancel()" value="取消"></p></form></body></html>

2
0
分享到:
评论

相关推荐

    PowerShell中prompt函数的妙用

    本文介绍PowerShell中的Prompt函数,并且通过Prompt函数来自定义PowerShell命令行界面的提示符。 在设计prompt函数之前,小编想把PowerShell命令行提示符改成zhanghong&gt;,不知道可不可以。找来找去,找到了prompt这...

    美化js系统函数alert,confirm,prompt,并实现lightbox效果

    美化js系统函数alert,confirm,prompt,并实现lightbox效果 美化js系统函数alert,confirm,prompt,并实现lightbox效果

    JS中confirm,alert,prompt函数区别分析

    JS中confirm,alert,prompt函数使用区别有哪些呢?

    js动态生成表格行列特效

    js在线生成表格代码,表格中带有颜色,可取色

    Cognos Prompt

    The techniques in this document depend on undocumented and unsupported aspects of the Cognos 8 Business Intelligence Cognos 8 Viewer (AKA Report Viewer). These techniques operate in Cognos 8 Viewer ...

    JS中confirm,alert,prompt函数使用区别分析

    JS中confirm,alert,prompt函数使用区别分析,需要的朋友可以参考下。

    ChatGPT高质量prompt技巧分享.pdf

    第 1 章:Prompt 工程技术介绍 什么是 Prompt 工程? 第 2 章:指令 Prompt 技术 示例: 第 3 章:角色 Prompt 第 4 章:标准 Prompt 第 5 章:零、一和少量样本 Prompt 第 6 章:“让我们想一想”Prompt 第 7 章:...

    PROMPT

    PROMPT

    SQLPrompt最新.zip

    SQLPrompt最新.zip

    SQL Prompt v5.3.0.3 SQL Prompt破解

    SQL Prompt v5.3.0.3 SQL Prompt破解

    SQLPrompt_10.1.4完美支持SSMS18.5 详细文档

    SQLPrompt_10.1.4.14671 支持SSMS18.5。 SQL Prompt是一款拥有SQL智能提示功能的SQL Server和VS插件。SQL Prompt能根据数据库的对象名称,语法和用户编写的代码片段自动进行检索,智能的为用户提供唯一合适的代码...

    SQLPrompt5.3破解

    1,安装SQLPrompt v5.3,这个不多说。 2,安装完毕后,断开网络连接。 3,打开Visual Studio或者SQL Server Management Studio(版本不限)。 4,在菜单栏找到SQL Prompt5,点击,找到Serial Number/Enter Serial ...

    SQLPrompt_9.5.0.9311破解版

    What's new in SQL Prompt SQL Prompt is now supported in SQL Server Management Studio 18! SQL Prompt is now supported in Visual Studio 2019! SQL Prompt now requires .Net Framework 4.7.2 or later. You ...

    SQLPrompt_7.4.0.471

    This build of SQL Prompt includes: Support for SQL Server Management Studio 17 Formatting improvements: Improvements to nested parentheses Case statements with comments now align correctly Now adds a ...

    SQLPrompt 7

    SQLPrompt 7各版本通用,SQLPrompt 7各版本通用,SQLPrompt 7各版本通用

    SQLPrompt9.1

    SQLPrompt9.1

    AI引擎:Prompt指令设计绿皮书

    CHATGPT prompt使用指南 AI引擎:Prompt指令设计绿皮书

    SQLPrompt_6.1.0.72

    SQL Prompt格式不会再用大写表达XML函数 在SQL Prompt代码片段里,你可以使用 $PASTE$把你剪贴板里的内容插入到查询里去 修复了在WIN8里的一些稳定问题 数据浏览器的功能由于没有多有实用性已经被移除了 用SQLPrompt...

Global site tag (gtag.js) - Google Analytics