Site Notice

hello, world

Difference between revisions of "中文变量名"

From Project-EPB Commons
([InPageEdit] 没有编辑摘要)
 
([InPageEdit] 没有编辑摘要)
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<html>
 
<html>
<button onclick="函数()">点击这里</button>
+
<button onclick="函数()">点击这里,执行函数</button> *字面意思
 
<script>
 
<script>
 +
var 空值 = null,
 +
    未定义 = undefined,
 +
    真 = true,
 +
    假 = false;
 +
 
function 函数() {
 
function 函数() {
 
var 模态框 = ssi_modal,
 
var 模态框 = ssi_modal,
 
     常用变量 = mw.config.get(['wgSiteName','wgUserName']),
 
     常用变量 = mw.config.get(['wgSiteName','wgUserName']),
     网站名称 = 常用变量[0],
+
     标题 = 网站名 = 常用变量.wgSiteName,
     用户名 = 常用变量[1];
+
     用户名 = 常用变量.wgUserName,
   模态框.show(
+
    内容,
     title: 网站名称,
+
    对话框 = 'dialog';
     content: '你的用户名是: ' + 用户名
+
  if (用户名 === 空值) {
   );
+
    内容 = '你尚未登录 ' + 网站名 +'!';
 +
  } else {
 +
    内容 = '你的用户名是: ' + 用户名;
 +
  }
 +
   模态框.show({
 +
     title: 标题,
 +
     content: 内容,
 +
    center: 真,
 +
    sizeClass: 对话框
 +
   });
 
}
 
}
 
</script>
 
</script>
 
</html>
 
</html>
 +
<pre>
 +
var 空值 = null,
 +
    未定义 = undefined,
 +
    真 = true,
 +
    假 = false;
 +
 +
function 函数() {
 +
var 模态框 = ssi_modal,
 +
    常用变量 = mw.config.get(['wgSiteName','wgUserName']),
 +
    标题 = 网站名 = 常用变量.wgSiteName,
 +
    用户名 = 常用变量.wgUserName,
 +
    内容,
 +
    对话框 = 'dialog';
 +
  if (用户名 === 空值) {
 +
    内容 = '你尚未登录 ' + 网站名 +'!';
 +
  } else {
 +
    内容 = '你的用户名是: ' + 用户名;
 +
  }
 +
  模态框.show({
 +
    title: 标题,
 +
    content: 内容,
 +
    center: 真,
 +
    sizeClass: 对话框
 +
  });
 +
}
 +
</pre>

Latest revision as of 03:25, 24 January 2020

<html> <button onclick="函数()">点击这里,执行函数</button> *字面意思 <script> var 空值 = null,

   未定义 = undefined,
   真 = true,
   假 = false;

function 函数() { var 模态框 = ssi_modal,

   常用变量 = mw.config.get(['wgSiteName','wgUserName']),
   标题 = 网站名 = 常用变量.wgSiteName,
   用户名 = 常用变量.wgUserName,
   内容,
   对话框 = 'dialog';
 if (用户名 === 空值) {
   内容 = '你尚未登录 ' + 网站名 +'!';
 } else {
   内容 = '你的用户名是: ' + 用户名;
 }
 模态框.show({
   title: 标题,
   content: 内容,
   center: 真,
   sizeClass: 对话框
 });

} </script> </html>

var 空值 = null,
    未定义 = undefined,
    真 = true,
    假 = false;

function 函数() {
var 模态框 = ssi_modal,
    常用变量 = mw.config.get(['wgSiteName','wgUserName']),
    标题 = 网站名 = 常用变量.wgSiteName,
    用户名 = 常用变量.wgUserName,
    内容,
    对话框 = 'dialog';
  if (用户名 === 空值) {
    内容 = '你尚未登录 ' + 网站名 +'!';
  } else {
    内容 = '你的用户名是: ' + 用户名;
  }
  模态框.show({
    title: 标题,
    content: 内容,
    center: 真,
    sizeClass: 对话框
  });
}