-
-
Notifications
You must be signed in to change notification settings - Fork 647
Expand file tree
/
Copy pathSampleVulnerability.js
More file actions
23 lines (22 loc) · 853 Bytes
/
SampleVulnerability.js
File metadata and controls
23 lines (22 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function addingEventListenerToFetchData() {
document
.getElementById("fetchDetails")
.addEventListener("click", function () {
/**
* getUrlForVulnerabilityLevel() method provides url to call the Vulnerability Level
* of Sample Vulnerability.
* e.g. /VulnerableApp/SampleVulnerability/LEVEL_1 for LEVEL_1
*/
let url = getUrlForVulnerabilityLevel();
/**
* doGetAjaxCall() method is used to do the ajax get call to the Vulnerability Level
*/
doGetAjaxCall(fetchDataCallback, url + "?name=dummyInput", true);
});
}
// Used to register event on the button or any other component
addingEventListenerToFetchData();
//Callback function to handle the response and render in the UI
function fetchDataCallback(data) {
document.getElementById("response").innerHTML = data.content;
}