目录
- 静态网页模拟查询/接受参数
- iframe框架实现跳转、一词多网页、全功能网页(见相关帖子)
- 任意网址渲染与跳转(mdx读取mdd内网页内容)
- Lorem culpa duis Lorem sint laboris commodo magna pariatur quis sunt commodo
代码可能无法正确显示。
静态网页模拟查询/接受参数
适合实现词典内查词等奇怪操作。
<!DOCTYPE html>
<html>
<body>
<script>
urlinfo = window.location.href;
document.
write(
""
,
urlinfo,
"")
//Debug len = urlinfo.split("?");
newsidinfo = len[1];
document.
write(
""
,
newsidinfo,
"");
//Debug parameter1 = newsidinfo.split("=")[1];
document.write("获取到的参数值是" + parameter1);
</script>
</body>
</html>
配合提交代码使用:
<form action="test2.htm">
<label for="word">Add your word:</label>
<input type="text" id="word" name="word"><br><br>
<input type="submit">
</form>
Credit:
https://www.cnblogs.com/jessie-xian/p/11596856.html
任意网址渲染与跳转
我们都知道图片中使用file网址会被自动替换为正确的mdd地址,但脚本中的网址不会。这时候可以利用自定义标签欺骗mdxbuilder。
<file href="file://A/index.html"></file>
<script type="text/javascript">
window.location.href=document.body.firstElementChild.getAttribute('href');
</script>
效果是直接跳转至mdd中的A/index.html去。(可用性存疑)
因为上文写死了是first Element Child(第一个标签),所以在这段定义上面不能有任何内容;也就是说应该在词条解释的第一行。