Commit 9321a650 authored by Jake Mylet's avatar Jake Mylet
Browse files

Completed ErrorJS doc page.

Minor update to ScanJS doc page wording.
Formatting update to GetError JS file.
parent 6d197735
# Error Page JavaScript
The JS functions specified below are run only on the Error Page.
### [GetError.js](/WAMI/WAMI/GetError.js)
GetError is designed built to retrieve the particular error message displayed on the Scan Error page. To do this it will first get the element that holds the error message by its ID, `ActionMessage`. With this element it will retrieve the message by getting the inner HTML content of the first HTML column element, `td` elements, replacing all commas with the '-' character and replacing html line break tags with commas to make parsing of the message simpler for the application, and then returning the error message.
var div = document.getElementById("ActionMessage");
var msg = div.getElementsByTagName("td")[0].innerHTML.trim().replace(",", "-");
return msg.replace(/<br>/g, ",");
**Note that layout or aesthetic changes to the Scan Error Page can cause unpredictable behavior.**
### [GoToScan.js](/WAMI/WAMI/GoToScan.js)
The GoToScan function is another very simple function, only consisting of one line of JavaScript. This function is used to proceed from the Scan Error page back to the Scan Page, it does this by calling the Scan Error Page `onContinue` function, which is internal to that page and directs the user back to the Scan Page.
#### References/See Also
* [JavaScript Strings](
* [HTML ELement](
\ No newline at end of file
......@@ -32,7 +32,7 @@ After retrieving all scan rows, the script will iterate through each of these ro
**Note that whitespace is irrelevant**
**Note that whitespace is largely irrelevant for a JSON string.**
......@@ -42,7 +42,7 @@ for (var j = 0; j < scannedRows.length; j++) {
// Go through each column in the row
for (var k = 0; k < rowChildren.length; k++) {
if (rowChildren[k].hasAttribute("title")) { // Info desired is held in colum title attribute
if (rowChildren[k].hasAttribute("title")) { // Info desired is held in column title attribute
var bookProp = rowChildren[k].title;
// Determine what the information is and add it to the scanned books JSON list
......@@ -61,7 +61,7 @@ for (var j = 0; j < scannedRows.length; j++) {
**Note that changes to the scanned list table can cause unpredictable behavior.**
**Note that layout or aesthetic changes to the scanned list table can cause unpredictable behavior.**
The function is dependent on encountering information in an expected order of barcode number, callnumber, and title while iterating through the columns of a row, with any scan error information stored in the callnumber. If this order changes the script will incorrectly identify certain properties or not save others if they are pushed out of it's range.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment