Hi @blackwat3r,
This all depends on your implementation.
You can use the JS code to extend your current code.
In my case it was a Magento template and that is the code you see in the example.
I'll explain the code a bit:
<?php if ( strpos( $_360path, 'http' ) !== false ): ?>
Here it checks...