I'm building a simple app on a SP2013 online intranet that uses the Google Books API to pull in GB content (title, author, image etc). The goal is to modify a SP list view to populate the book isbn using a jslink file, so the correct book gets rendered. My custom item line looks like this but doesn't work:
var ret = "<script>var googleAPI = 'https://www.igoogleapis.com/books/v1/volumes?q=" + ctx.CurrentItem.Book_x0020_id + "';></script>"; return ret;
Is it even possible to include a script variable declaration within a jslink file? Another option would be to use a calculated field instead, but SP encodes some of the html causing the script to break.