Unexpected Token: ILLEGAL on include load

  • 1
  • Problem
  • Updated 3 years ago
I'm getting this when trying to load a page include via javascript from a queue.


Here's the javascript that's running the load:

console.log('select queue item arguments:');console.log(arguments[0]);
var pageInclude = skuid.$('#ChartInclude').data('object'),
    row = arguments[0].row,
    rowType = row.attributes.type.slice(0,-3);
pageInclude.pagename = 'Chart_' + rowType;
pageInclude.querystring = '?id=' + row.Id;
console.log(pageInclude);
pageInclude.load(function(){
  console.log('Loaded ' + rowType + ' page include.');
});
skuid.events.publish('queueItemSelected',[rowType + 'Tabs']);
The console is showing the log of pageInclude, but .load() is failing.

The reason for some of the shenanigans here is that I'm loading the same page include component with different pages from a series of nested queues (a la the windows file tree, Hat Tipped to Josh Culter for showing me his Treebeard page). The script is working fine for the master queue and the first sublevel, but failing on the third (and last) level.

Any thoughts on what might be causing this?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Some additional info from the console:
:
the pagename and querystring seem to be set correctly.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
I may have isolated the problem. I ran the included page by itself, and here is where the error is being thrown:



Does that mean anything to anyone?

As far as I can tell, there's nothing wrong with the XML.
(Edited)
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
help?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
...
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,490 Points 10k badge 2x thumb
Looks like you have a newline character in your displaytemplate. Remove that and it should work. I've reported this as a bug.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Thanks! What a needle to find in that haystack. Nice work, Ben.