Page 1 of 1

Can we execute javascript function from inside HTML5 pano?

Posted: Wed Aug 10, 2011 5:41 am
by ScottWitte
I would like to execute a javascript function (defined on the web page) as a result of clicking a button within an HTML5 pano. By my understanding this should easily be done using the "Go To URL" action. Instead of the URL being "http://mypage.html" it could be "javascript:my_function();" That substitution would work in a href link on the page. Why not an href link in the pano?

Re: Can we execute javascript function from inside HTML5 pan

Posted: Sun Aug 21, 2011 12:28 pm
by Hopki
Hi Scott
Have you tried it?
I have not as yet, but thats not to say it will or will not work.
Have a go and let me know how you get on.
Regards
Hopki

Re: Can we execute javascript function from inside HTML5 pan

Posted: Sun Aug 21, 2011 4:04 pm
by ScottWitte
Hopki wrote:Have you tried it?
An obvious question that I should have answered from the start.

Yes. I tried it but it didn't work and that makes no sense to me for the reason stated.

Thomas probably knows the answer to this. If there is no way to make it work currently it sure would be a great addition for a future release.

Re: Can we execute javascript function from inside HTML5 pan

Posted: Thu Nov 17, 2011 10:52 am
by commodore64
Maybe you could edit the skin.js?
Look for "onclick".

Re: Can we execute javascript function from inside HTML5 pan

Posted: Thu Nov 17, 2011 5:05 pm
by ScottWitte
"onClick" is one event that can initiate an action. In my case, yes I used it. The resulting action of executing javascript remains elusive. Makes no sense to me as to why. But I gather there are few who have an interest in doing something like this.

It is too bad. There is some great functionality that could be added to Pano2VR if it were possible. The sort of capabilities that are possible using actionscript in Flash, for instance. My immediate interest was to send tracking information to my analytics program. I wanted to know which panos are being looked at, for example.

Scott

Re: Can we execute javascript function from inside HTML5 pan

Posted: Fri Nov 18, 2011 10:25 am
by commodore64
You could see stats on the server? (awstats)

javascript:alert(1);
works on buttons, but it seemed to open empty page also..

Re: Can we execute javascript function from inside HTML5 pan

Posted: Mon Nov 21, 2011 9:56 am
by commodore64
hmm.. now I need this functionality also,
atleast it works, if you modify skin.js:

..
this.__div.onclick=function () {
me.skin.hotspotProxyClick(me.hotspot.id);
// your function call here (executed when hotspot is clicked)
..