[Xerte] Re: FileLocation into URL link?

Smith, John J.J.Smith at gcu.ac.uk
Tue Sep 10 07:10:55 BST 2013


Hi Dave,

That onclick handler executes javascript in the global context so if var FileLocation has already been declared then it's simply running the line of Javascript:

window.location.href = FileLocation + 'image.jpg';

which would evaluate. You would only need eval if you had the equation stored as a string literal

var path = " FileLocation + 'image.jpg' ";
window.location.href = eval(path);

We have to do that in Xenith since the string is coming from the xml. This is all JavaScript though, not sure how it would get run in Flash. You can execute javascript from Flash but it's getting access to the FileLocation variable...

I think you would have to add a

<script>var FileLocation = "<% echo VAR %>";</script>

Somewhere in the play.php file of the Flash engine part if this is not already there (which I don't see any reason why it would be)...

I could take a look later RonM2

Regards,

John Smith | Learning Technologist
Room A251, Govan Mbeki Building | School of Health & Life Sciences | Glasgow Caledonian University
Cowcaddens Road | Glasgow | G4 0BA
________________________________________
From: xerte-bounces at lists.nottingham.ac.uk [xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett [d_b_burnett at hotmail.com]
Sent: 10 September 2013 01:42
To: Xerte list
Subject: [Xerte] Re: FileLocation into URL link?

I don't think a text string will be aware of FileLocation.
Maybe {FileLocation} will eval, but I doubt it.



> From: knowledgeware at kccsoft.com
> To: xerte at lists.nottingham.ac.uk
> Date: Mon, 9 Sep 2013 17:17:29 -0700
> Subject: [Xerte] Re: FileLocation into URL link?
>
> This looks promising John but can't get it to work...the link just sits there looking at me, doesn't seem to respond.
>
> Ron
>
> -----Original Message-----
> From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Smith, John
> Sent: Monday, September 09, 2013 3:33 PM
> To: xerte at lists.nottingham.ac.uk
> Subject: [Xerte] Re: FileLocation into URL link?
>
> Something like
>
> <a href="#" onclick="window.location.href=FileLocation + 'image.jpg'; return false;">Link</a>
>
> Regards
>
> John Smith
> Learning Technologist
> School of Health and Life Sciences
>
> Sent from Samsung Galaxy SII
>
>
>
> KnowledgeWare <knowledgeware at kccsoft.com> wrote:
>
>
> I’m wondering if there is a way to utilitize the ‘FileLocation’ var info in a URL link in html on a typical xerte page. Ie
>
> <a href=FileLocation +’media/rontest.pdf’> open pdf file <a>
>
> I can’t get any permutation to work…. I know I’m using a screwdriver as a hammer… : - (
>
> Anyone done this?
>
> Thanks
> RonM2
>
>
> 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.
>
> 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.
>
>
> Glasgow Caledonian University is a registered Scottish charity, number SC021474
>
> Winner: Times Higher Education’s Widening Participation Initiative of the Year 2009 and Herald Society’s Education Initiative of the Year 2009.
> http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html
>
> Winner: Times Higher Education’s Outstanding Support for Early Career Researchers of the Year 2010, GCU as a lead with Universities Scotland partners.
> http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html
> _______________________________________________
> Xerte mailing list
> Xerte at lists.nottingham.ac.uk
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>
>
>
> _______________________________________________
> Xerte mailing list
> Xerte at lists.nottingham.ac.uk
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte


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.

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.

Glasgow Caledonian University is a registered Scottish charity, number SC021474

Winner: Times Higher Education’s Widening Participation Initiative of the Year 2009 and Herald Society’s Education Initiative of the Year 2009.
http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html

Winner: Times Higher Education’s Outstanding Support for Early Career Researchers of the Year 2010, GCU as a lead with Universities Scotland partners.
http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html



More information about the Xerte mailing list