<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle21
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle22
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle23
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle24
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Thanks John<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I should have explained - I can get it working via rss_proxy but not without<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I have the following:<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>var pastedurl = x_currentPageXML.getAttribute("url");<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>var shorturl = "http://is.gd/api.php?longurl="+pastedurl;<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>The value of pastedurl from the xml is http://nottingham.ac.uk/xerte<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>If I do alert(shorturl); I get http://is.gd/api.php?longurl=http://nottingham.ac.uk/xerte<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>and if I visit http://is.gd/api.php?longurl=http://nottingham.ac.uk/xerte in a browser window I get http://is.gd/dS1Cst so up to that point it's all working fine<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>But I obviously need to read in the result of shorturl to display on the page<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I've tried the following:<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>jQuery.get(shorturl, function(data) {<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> var myvar = data;<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> alert(myvar);<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> });<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I don't get an alert<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>If I do <o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>$.ajax({<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> url: 'http://localhost/test.txt',<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> cache: false<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> }).done(function( html ) {<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> alert(html);<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> });<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I get the results of the text file in the alert<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>but if I do<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>$.ajax({<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> url: shorturl,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> cache: false<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> }).done(function( html ) {<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> alert(html);<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> });<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I don't get an alert<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>If I then change shorturl to <o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>var shorturl = "http://localhost/newxottrunktest/rss_proxy.php?rss=http://is.gd/api.php?longurl="+pastedurl;<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>and <o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>$.ajax({<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> url: shorturl,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> cache: false<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> }).done(function( html ) {<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> alert(html);<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> });<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>It works and I get the shorturl<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>So I guess this is the same origin policy issue?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Any suggestions?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Cheers<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Ron<o:p></o:p></span></p><p class=MsoNormal><a name="_MailEndCompose"><span style='color:#1F497D'><o:p> </o:p></span></a></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> xerte-dev-bounces@lists.nottingham.ac.uk [mailto:xerte-dev-bounces@lists.nottingham.ac.uk] <b>On Behalf Of </b>Smith, John<br><b>Sent:</b> 01 November 2012 14:32<br><b>To:</b> For Xerte technical developers<br><b>Subject:</b> [Xerte-dev] Re: QRcode page for html5 version<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Post some code and I’ll cast an eye over it…<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><div><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>John Smith<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Learning Technologist<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>School of Health & Life Sciences<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Glasgow Caledonian University<o:p></o:p></span></p></div><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> <a href="mailto:xerte-dev-bounces@lists.nottingham.ac.uk">xerte-dev-bounces@lists.nottingham.ac.uk</a> [<a href="mailto:xerte-dev-bounces@lists.nottingham.ac.uk">mailto:xerte-dev-bounces@lists.nottingham.ac.uk</a>] <b>On Behalf Of </b>Ron Mitchell<br><b>Sent:</b> Thursday, November 01, 2012 2:33 PM<br><b>To:</b> 'For Xerte technical developers'<br><b>Subject:</b> [Xerte-dev] Re: QRcode page for html5 version<o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Thanks John<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>can't get that to work at the moment :-( will try again later.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Cheers<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Ron<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> <a href="mailto:xerte-dev-bounces@lists.nottingham.ac.uk">xerte-dev-bounces@lists.nottingham.ac.uk</a> [<a href="mailto:xerte-dev-bounces@lists.nottingham.ac.uk">mailto:xerte-dev-bounces@lists.nottingham.ac.uk</a>] <b>On Behalf Of </b>Smith, John<br><b>Sent:</b> 01 November 2012 14:00<br><b>To:</b> For Xerte technical developers<br><b>Subject:</b> [Xerte-dev] Re: QRcode page for html5 version<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Hi Ron,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>To load data into the HTML5 player you’ll want to do an ajax call. In its simplest form:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>$.ajax({<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> url: "test.html",<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> cache: false<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>}).done(function( html ) {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> // do something with html<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>});<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>If you try to do this cross server then you may run into the same origin policy though (<a href="http://en.wikipedia.org/wiki/Same_origin_policy">http://en.wikipedia.org/wiki/Same_origin_policy</a>) <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>The only way to do that is to do an ajax JSON with callback request (well tehnically its not ajax) but the page must return a valid JSON object wrapped in a function name, which may require creating a new file on a remote server…<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Take a look at how the delicious, rss and youtuberss ones work, it’ll be similar.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>One think to think about though is that If you get it working in toolkits using proxy_rss then it won’t work if exported to run in a scorm player…<o:p></o:p></span></p><div><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>John Smith<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Learning Technologist<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>School of Health & Life Sciences<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Glasgow Caledonian University<o:p></o:p></span></p></div><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> <a href="mailto:xerte-dev-bounces@lists.nottingham.ac.uk">xerte-dev-bounces@lists.nottingham.ac.uk</a> [<a href="mailto:xerte-dev-bounces@lists.nottingham.ac.uk">mailto:xerte-dev-bounces@lists.nottingham.ac.uk</a>] <b>On Behalf Of </b>Ron Mitchell<br><b>Sent:</b> Thursday, November 01, 2012 1:04 PM<br><b>To:</b> 'For Xerte technical developers'<br><b>Subject:</b> [Xerte-dev] QRcode page for html5 version<o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal>Hi Fay<o:p></o:p></p><p class=MsoNormal>like Jonathan I thought I'd have a go with the html5 stuff and at converting one of the pages you haven't yet converted. As the QR code page was one I put together I thought I'd have a go at that. I used your textGraphics.html page as a starting point and have this working reasonably well as far as I can tell but have attached a copy here rather than committing it for now.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The bit I haven't got working and haven't even tried yet is how to grab the short url. In the flash version I used readfile() and in the case of xot use it together with rssproxy e.g.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>myurl.readFile(_level0.site_url + 'rss_proxy.php?rss=' + "<a href="http://is.gd/api.php?longurl=">http://is.gd/api.php?longurl=</a>"+pastedurl);<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>my question is what's the equivalent of readFile for use with the xenith code? e.g. to read and display the result of something like <a href="http://is.gd/api.php?longurl=%22http://nottingham.ac.uk/xerte">http://is.gd/api.php?longurl="http://nottingham.ac.uk/xerte</a>" which just displays the text on screen<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Cheers<o:p></o:p></p><p class=MsoNormal>Ron<o:p></o:p></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p> </o:p></span></p><p>This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. <o:p></o:p></p><p>This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. <o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br></span><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:gray'>Glasgow Caledonian University is a registered Scottish charity, number SC021474<br><br>Winner: Times Higher Education’s Widening Participation Initiative of the Year 2009 and Herald Society’s Education Initiative of the Year 2009.<br><a href="http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html">http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html</a><br><br>Winner: Times Higher Education’s Outstanding Support for Early Career Researchers of the Year 2010, GCU as a lead with Universities Scotland partners.<br><a href="http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html">http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html</a></span><span lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br></span><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:gray'>Glasgow Caledonian University is a registered Scottish charity, number SC021474<br><br>Winner: Times Higher Education’s Widening Participation Initiative of the Year 2009 and Herald Society’s Education Initiative of the Year 2009.<br><a href="http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html">http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html</a><br><br>Winner: Times Higher Education’s Outstanding Support for Early Career Researchers of the Year 2010, GCU as a lead with Universities Scotland partners.<br><a href="http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html">http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html</a></span><span lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p></div></body></html>