You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Friday, October 1st 2010, 10:11am

Using js() action

Hi!
I'm trying to understand, how to use js() action in my pano. For example, i will call javascript function on clicking the hotspot

Source code

1
<hotspot name="test" onclick="js(myTestJavascriptFunction());" />

In HTML file test.html i have this function.
How should i link xml and html files to make it working?

Zephyr

Professional

Posts: 1,003

Location: Netherlands

Occupation: Web developer

  • Send private message

2

Friday, October 1st 2010, 10:24am

You dont need to link them (only if you want JS to do something with krpano, not the other way around)

Just make sure you have
so.addParam("allowScriptAccess","sameDomain");

3

Friday, October 1st 2010, 10:31am

Hi,

what do you mean with "link xml and html" ?

the call itself is right, and when you have a "myTestJavascriptFunction" Javascript function defined anywhere
(it doesn't matter if it is in an included .js file or inside the html) it should work...

...but as note - when testing the javascript interface locally - then the flash must be in a trusted folder (see here),
otherwise the javascript interface will not work (there will be a warning in the krpano log - external interface not available),

best regards,
Klaus

4

Friday, October 1st 2010, 10:33am

To Klaus

Thank you very much, i'll try it now

Upd:
Aaaaaaaaaaaaa, it works, IT WORKS!!!!!!!!
*w00t* *w00t* *w00t*

Similar threads