Forum How do I...?

Problem loading jquery?

Not sure if it's a 'how do I' or a 'bug'.
But I can't seem to get Prince to read the jquery bits of code.
I used Mark.js ( to highlight some of the words of my document. It works on screen in the browser, but when I run Prince, through the Terminal, the generated PDF doesn't have the highlighted text...
Any idea why this is happening?
I tried changing the jquery version to 1.0 but it doesn't work either.
Thank you.
It appears that Mark.js is using JavaScript object properties with custom getter/setter functions, something that Prince doesn't support yet. In the future we hope to support this.
Thanks @mikeday. I figured.
I found out that there were a few problems along the line and have found a workaround for highlighting.
@mikeday Can you please elaborate what you mean with custom getter/setter functions so that we know what exactly isn't supported?

@tart2000 Can you please share your workaround? And at best a code example demonstrating your problem?

Thank you both in advance.
JavaScript allows you to define special object properties that call get/set functions instead of just being regular values, which Mark.js uses for its options processing code. It looks like we can support these in the next release of Prince, but we will also need to support some additional methods such as Array.every() which Mark.js also uses. Hopefully we can do this too.
I used Stefan Seiger's solution here instead of mark.js:

Using jQuery 1.6.

I also found out there was a problem with using after().
(couldn't really pinpoint what was wrong, but I ended up using append() and it works fine)

Finally, topic title should be 'how to highlight specific text' rather than 'load Jquery'...

Hope that helps...
@tart2000 Thanks for this information. I'm glad you've solved it.

@mikeday Thank you for this information. If I understand you correctly some ECMAScript 5 methods are missing in your implementation. I'm looking forward to the solution!

I personally wouldn't recommend to use this solution because the implementation reasons the author described seem to be wrong (see this comment), what makes me skeptical. Furthermore you don't have a guarantee that it'll work in each scenario or browser, as there are no cross-browser unit tests.
Today we have released an updated latest build of Prince which should hopefully support mark.js! :D

Specifically it adds support for JavaScript accessor properties, the Array.every method, and the Element.matches method, among other things.
The latest build of Prince now supports the get/set syntax for defining accessor properties in JavaScript object initialisers.