How to detect if JavaScript is disabled after loaded HTML?

  • Hi,

    have a look into any of the krpano html files - there is a <noscript> element there - and the content of that element will be shown when Javascript is disabled.

    With the default krpano html files the text 'ERROR: Javascript not activated' will be shown centered in the viewer window.

    Best regards,
    Klaus

  • Thanks Klaus and Index. Then as said Index:

    if javascript is disabled, there is no krpano, because krpano is javascript

    Then krpano always (flash too) is based javascript.
    Then, for example, the klaus html_div example runs always if is loaded krpano, because javascript is enable. Never is loaded krpano without javascript enable-

    Please confirm all the above *wink*
    Greets,
    Fernando.

  • Hi,

    Then krpano always (flash too) is based javascript.


    The embedding code is Javascript, so yes, without Javascript the krpano viewer will not get added to the webpage.

    If you want you could additionally also embed the krpano.swf Flash viewer in the <noscript> via an <object> element, but I don't think that makes much sense - first when the user manually disables Javascript, then he probably doesn't want Flash too - and second - all the Browser workarounds and fixes to Flash that will be done by Javascript (e.g. the detection if Flash is even available or the mouse wheel support) are not available too.

    Best regards,
    Klaus

  • Thanks, I was confused. My old projects did not work in flash but in html5, that was the problem. The problem was not related to javascript. The solution is to avoid flash when in the code there is javascript:

    <script>
    embedpano({swf:"p1/tour.swf", xml:"p1/tour.xml", target:"pano", html5:"only", passQueryParameters:true});
    </script>
    My question now is:
    Why keeping on working with Flash?


    Greets,
    Fernando

Participate now!

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