免费注册 登录
掌上百科 - PDAWIKI 返回首页

firetimer的个人空间 https://www.pdawiki.com/forum/?326877 [收藏] [复制] [分享] [RSS]

日志

做词典的奇技淫巧

已有 314 次阅读2020-5-10 18:32 |个人分类:奇技淫巧

目录
  1. 静态网页模拟查询/接受参数
  2. iframe框架实现跳转、一词多网页、全功能网页(见相关帖子)
  3. 任意网址渲染与跳转(mdx读取mdd内网页内容)
  4. 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(第一个标签),所以在这段定义上面不能有任何内容;也就是说应该在词条解释的第一行。

路过

鸡蛋

鲜花

握手

雷人

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 免费注册

小黑屋|手机版|Archiver|PDAWIKI |网站地图

GMT+8, 2024-3-29 00:49 , Processed in 0.024218 second(s), 8 queries , MemCache On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

返回顶部