Advertisement
tahola

Untitled

Mar 9th, 2016
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.98 KB | None | 0 0
  1. <?php
  2. if(preg_match('#ios|apple#i', $_SERVER['HTTP_USER_AGENT'])){
  3.     echo'<script src="/js/cordova/ios/cordova.js"></script>';
  4. }
  5. // if android
  6. else{
  7.     echo'<script src="/js/cordova/android/cordova.js"></script>';
  8. }
  9. ?>
  10. <script src="/js/cordova/SocialSharing.js"></script>
  11. <script src="/js/cordova/InAppBrowser.js"></script>
  12. <script src="/js/jquery-1.11.2.min.js"></script>
  13. <script src="/js/custom.js?v=<? echo numcachestatics; ?>"></script>
  14. <script type="text/javascript">
  15. $(document).ready( function()
  16. {
  17.     $(document).on('click', '.itempub', function(e){
  18.  
  19.     e.preventDefault();
  20.     var $this = $(this);
  21.     var target = $this.data('inAppBrowser') || '_system';
  22.  
  23.     window.open($this.attr('href'), target);
  24.  
  25.     });
  26.  
  27.     $(document).on('click', 'a[href^=http], a[href^=https]', function(e){
  28.  
  29.     e.preventDefault();
  30.     var $this = $(this);
  31.     var target = $this.data('inAppBrowser') || '_system';
  32.  
  33.     window.open($this.attr('href'), target);
  34.  
  35.     });
  36.  
  37. });
  38. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement