JavaScript insertion on dita files
Posted: Wed Sep 19, 2018 5:32 pm
Hi,
I would like to insert a javascript code in my dita file but, even after reading oxygen documentation, I don't really understand. It would be for webhelp output responsive content.
The object looks like this in the HTML page of our platform :
How could I be able to insert that script on author, directly form my dita page? I have created a js file on the output for webhelp responsive.
Plus, I'm not able to use the <script> tag.
Thanks in advance.
Regards,
Jeremy
I would like to insert a javascript code in my dita file but, even after reading oxygen documentation, I don't really understand. It would be for webhelp output responsive content.
The object looks like this in the HTML page of our platform :
Code: Select all
<script type="text/javascript">
function generate() {
var login = document.getElementById('login').value;
var password = document.getElementById('password').value;
var tokenField = document.getElementById('token');
var token = 'Basic ' + btoa(login+':'+password);
tokenField.value = token;
return false;
}
</script>
</head>
<body>
<h1>
<table>
<tr>
<td><img style="margin-top:10px" src="/img/logo.png"/>
</td>
<td>APIs Authentication</td>
</tr>
</table>
</h1>
<div class="section">Token generation</div>
<p>The token value is "Basic " + base64encode(login + ":" + password)</p>
<form onsubmit="return generate()">
<table>
<tr>
<td>Login</td><td><input type="text" id="login" /></td>
</tr>
<tr>
<td>Password</td><td><input type="password" id="password" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Generate" /></td>
</tr>
<tr>
<td>Token</td>
<td><input type="text" id="token"></td>
</tr>
</table>
</form>
<div class="section">More infos</div>
<p>Wikipedia description</p>
<a class="gray" href="https://en.wikipedia.org/wiki/Basic_access_authentication#Client_side">https://en.wikipedia.org/wiki/Basic_access_authentication#Client_side</a>
Plus, I'm not able to use the <script> tag.
Thanks in advance.
Regards,
Jeremy