I'm converting a website in modx which makes use of a java wrapper to dynamically pull in content and display it without any page reloading. the basics of the site are there but I'm having a slight issue with generated links and I'm not sure what the best way to get around it is.
I didn't write the original javascript that the site uses, I'm just trying to refactor it slightly so modx leverages the right pieces.
Here is an example of the template I'm using to page next/previous
<div id="next"></div>
<script type="text/javascript">
$(function()
{
setNext('[[+href]]');
var page_content_height = $('#page_content').height();
}
);
</script>
Basically modx's generated links take the following format in the page:
setNext('nb/index.php?id=17&page=2');
For them to work, they need to be:
setNext('nb/index.php?id=17&page=2');
The sites using jquery, I was thinking there might be a way I can get that to convert text strings before it renders the page?
Hope someone can point me in the right direction cos I'm a bit stumped atm.
This would do the trick
var str = 'nb/index.php?id=17&page=2'
str = str.replace(/&/g, '&');
setNext(str);