- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2016 09:29 AM
I'm trying to set up a UI page in SNow and am receiving the error "missing name after . operator" when trying to save. I've included the code that it is referencing as the problem below but can include all of it if that seems necessary. The spot that is specifically referenced is line 7 column 98. This code works properly outside of SNow so I'm assuming it is caused by how SNow interprets the JavaScript. I've done some digging and came up with the idea that I am using a reserved word but changing out ui for testVar came up with the same error so I'm not sure what the reserved word might be. Any help is appreciated.
//when element is dragged to #chosen
$( "#chosen" ).sortable({
receive: function( event, ui ) {
//iterate through the snowIssuesArray
for (i=0;i < snowIssuesArray.length;i++){
//find the match
if (snowIssuesArray[i][0] == ui.item[0].innerHTML && snowIssuesArray[i][1] == ui.item[0].class){
//and remove it
snowIssuesArray.remove(i);
}
}
}
});
Solved! Go to Solution.
- Labels:
-
User Interface (UI)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2016 11:49 PM
class is the reserved word. You need to change class to something else.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2016 03:53 PM
It's not just ServiceNow. That is the whole point of reserved words. If you want the class attribute then use .getAttribute()
ui.item[0].getAttribute('class')
DOM Element getAttribute() Method
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2016 07:36 AM
Thank you for the help. I guess the browser I was using might just have been more fault tolerant then it should have. I'll make sure to avoid that in the future.