krpano().call is not a function

  • I have a problem to call the krpano().call(..) method when I include the jQuery Mobile library (http://code.jquery.com/mobile/1.0rc1/…e-1.0rc1.min.js).

    The browser console said: "krpano().call is not a function". Works perfectly with krpanoJS.

    My goal is to load a new pano as shown below: "krpano.call("loadpano('pano2.xml')");"
    Unfortunately when I introduce the pagination with JQM, the browser console returns me the error.

    Is it possible that I mistake something? Thanks.

    Edited once, last by ranone (October 5, 2011 at 7:12 PM).

  • Make shore that you wrote code correctkrpano().call(..) - not right
    krpano.call(..) - right


    And if you test your code localy - this is not work becouse security error
    go to
    http://www.macromedia.com/support/docume…_manager04.html
    and add you krpano.swf or folder to secure list


    Hope it help


    Andrey

  • Hi,

    that can be timing error - the call function is only there when the viewer itself was already embedded and loaded,
    either check for the "call" function via a Timer (setInterval or setTimeout) or make a call from xml back to js to notify the javascript that the viewer is loaded and ready for calls,

    beside of this - when using the kprotect tool - then make sure that the Javascript Interface is not disabled there,

    best regards,
    Klaus

  • a document ready doesnt mean that krpano is ready. Krpano should trigger your script, not the dom.

    <krpano onstart="js(krpano_ready())" >

    and krpano_ready would be a function that initiazis your javasvcript (for isntance binding elements with the onclick $(".button").click(function(){ krpano().call("trace(click)");});)

    alsoo what does krpano() do? return a DOM object of krpano?

  • Below I report my code. When I click to change the pano, krpano is an "HTMLEmbedElement object" and the browser console returns the error.

    I load the first pano immediately (here no problem); after when there is a request for a pano switching I invoke the "krpano.call()" method that load a new pano and jQuery Mobile does the rest with paging (here the error occur).

    In html page:

    In javascript file:

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!