javascript - Adobe 动态表单 : Javascript to find URL domain the form is open under

标签 javascript adobe livecycle-designer

我已经尝试了我所知道的所有 JavaScript 方法来找出域是什么。我需要表单根据打开的网站在按下按钮时做出不同的 react 。到目前为止,没有任何效果,我只能找到有关如何确定客户端是 Reader 还是浏览器的文档。但这对我没有帮助。

最佳答案

in 运算符非常漂亮...

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>JavaScript Domain</title>
<script type="application/javascript">
//<![CDATA[
window.onload = function(e)
{
 for (i  in window.location) {alert('i = '+i);}
 alert(window.location.host);
 alert(window.location.hostname);
}
//]]>
</script>
</head>

<body>

<div><p>JavaScript Domain</p></div>

</body>
</html>

关于javascript - Adobe 动态表单 : Javascript to find URL domain the form is open under,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18156203/

相关文章:

javascript - 在 LiveCycle Designer 中包含 Moment.js

javascript - 将变量传递给 :eq jquery selector in a while loop

javascript - RegExp 仅查找第一个括号内的字符串?

actionscript-3 - Adobe 动画碰撞

javascript - Adobe Illustrator - 自动将 TrueType 字体更改为 OpenType 版本

Adobe LiveCycle Designer 隐藏文本字段的标签描述

javascript - 点击提交按钮后不应采取任何操作 (Adobe Livecycle)

javascript - NodeJS/Express/ExpressHandlebars - 全局辅助函数

javascript - 反向地理编码以返回完整格式的地址

apache-flex - Flex Air,静态主窗口引用?