Javascript errors reported [message #1867095] |
Fri, 14 June 2024 10:00  |
Eclipse User |
|
|
|
Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components)
Version: 2024-06 (4.32.0)
Build id: 20240606-1231
The following code within Eclipse reports multple errors including "semicolon expected". However the same code when validated using https://www.commontools.org/tool/javascript-validator-79
reports no problems.
If there some way I can determine the nature of the problem so that I can resolve these errors in Eclipse.
/*jshint esversion: 6 */
/*jshint esversion: 8 */
function getContextPath() {
let result = window.location.pathname.substring(0, window.location.pathname.indexOf("/",2));
return result;
}
async function newResult(trayID,sampleID,userID,testID,resultID) {
const dataObject = {
trayID: trayID,
sampleID: sampleID,
userID: userID,
testID: testID,
value: resultID
};
console.log(JSON.stringify(dataObject));
let response = await fetch(getContextPath()+"/TrayResults", { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(dataObject) })
.then((response) => {
if (!response.ok) {
throw new Error(`HTTP error, status = ${response.status}`);
}
return response.json();
})
.then((data) => {
/*for (const panel of data) {*/
console.log("Returned value trayID=" + data.trayID + " sampleID="+data.sampleID);
/*}*/
})
.catch((error) => {
console.log("Error " + error);
});
console.log(response);
}
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02561 seconds