Table plus |
---|
applyColStyleToCell | true |
---|
heading | 0 |
---|
columnTypes | s,s,s,s |
---|
multiple | false |
---|
columnAttributes | style="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold, |
---|
enableSorting | false |
---|
|
Syntax | lfExecuteJS(jsFilePath) | Package | | Alias | | Pkg Usage | | |
Description
Excerpt |
---|
|
Gives you the possibility to run your own javascript code. |
Gives you the possibility to run your own javascript code.
Parameters
Table plus |
---|
applyColStyleToCell | true |
---|
columnTypes | s,s,s,s |
---|
heading | 0 |
---|
multiple | false |
---|
enableSorting | false |
---|
|
Parameter name | Type | Required | Description |
---|
jsFilePath | String | Yes | The script source to run that contains your javascript code. The file is resolved relative to silprograms path. | |
Return Type
None
Examples
Example 1
For this example we will first create a file with the following javascript code and save it on the disk as hook.js.
Code Block |
---|
|
AJS.$('#summary-val').get(0).childNodes[0].nodeValue = "Executing my javascript";
AJS.$('#descriptionmodule').hide(); |
Now we call the lfExecuteJS routine like in the code block below. For the jsFilePath parameter you can either give the relative path (as in the example above) or the absolute path. When this routine is called, the javascript code from hook.js is executed. This will set the summary value on the issue page and will hide the description.
Code Block |
---|
|
lfExecuteJS("hook.js"); // jsFilePath = "hook.js" |
Example 2
The file designated by the jsFilePath parameter must contain only JavaScript code. Note that this code will be inlined, so do not use single line comments!
Code Block |
---|
|
var v = "a";
// let's show an alert
alert(v); |
The alert() will never be called because the script (above) will be evaluated to:
Code Block |
---|
|
var v = "a"; // let's show an alert alert(v); |
See also
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 25 |
---|
showSpace | false |
---|
cql | label = "lf_routine" and space = currentSpace ( ) |
---|
labels | array_routines |
---|
|