(function ($, Drupal, drupalSettings) { var url = jQuery('#url').val(); if(url != ''){ go_toStore(url); } })(jQuery, Drupal, drupalSettings); function go_toStore(url){ if(confirm("Application YellowPages") == true){ window.location = "myapp://Thailand Yellowpages" } }