Hi,
you can't send krpano action code directly to the Javascript!
See here how to get and use the krpano Javascript interface:
http://krpano.com/docu/js/#top
That means - first you would need to get the Javascript 'interface' object and then use the 'call' function from that object to send the krpano action code.
Best regards,
Klaus