week3.2
This commit is contained in:
17
index.js
Normal file
17
index.js
Normal file
@@ -0,0 +1,17 @@
|
||||
// your_script.js
|
||||
|
||||
export function executeOperation(operationChoice) {
|
||||
fetch(`/path/to/your_script.py?operation=${operationChoice}`)
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! Status: ${response.status}`);
|
||||
}
|
||||
return response.text();
|
||||
})
|
||||
.then(data => {
|
||||
alert(data); // You can handle the response data as needed
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user