conflicting javascript

  • Hi,

    I noticed, once I registered my ipad licence, my Underscore.JS doesn´t work. When looking into the DOM, I see that krpano overwrites the _ object. I rather not put Underscore into another object (I like the syntax, and I the krpano object is only used internally), so is there a way to move the krpano javascript object to another object? Something like _krpano? a krpano.noConflict() mode :P

    I tried:

    Code
    <script src="tour.js"></script>
    	<script type="text/javascript">
    		window._krpano = window._;
    	</script>
        <script type="text/javascript" src="KrpanoJSF/vendors/underscore/underscore-min.js"></script>

    But that basicly breaks Ipad compatibility

  • For now I solved it by passing underscore in an automatic executing anomynous function

    Code
    <script src="underscore.js"></script>
    <script src="jquery.js"></script>
    <script type="text/javascript">
    (function($, _, undefined) {
      <!-- your code here is save from overwriting -->
    }(jQuery, _));
    </script>

    But it would be nice, in the future to have the ability to move the _ krpano object to another object of choice (noConflict mode like jquery).

Participate now!

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