@George Siggouroglou: यह एक अच्छा विचार तत्वों के लिए एक आईडी है कि अंततः एक दस्तावेज़ में एक से अधिक समय में दिखाई देगा का उपयोग नहीं है। कोड को अधिक मॉड्यूलर बनाने के लिए इसके अच्छे अभ्यास के बजाए।
अगर इसकी भी एक अच्छा विकल्प की उम्मीद टच डिवाइस से पहले "नल" का उपयोग करने के "क्लिक" क्योंकि यह बहुत तेजी से और पहले आग एक क्लिक से। टच सक्षम सामानों की जांच करने के लिए मैं आधुनिकता का उपयोग करना पसंद करता हूं क्योंकि यह सुविधा को हवा का पता लगाता है।
The jQuery Mobile tap event triggers after a quick, complete touch event that occurs on a single target object. It is the gesture equivalent of a standard click event that is triggered on the release state of the touch gesture. https://api.jquerymobile.com/tap/
आशा व्यक्त की कि किसी
**html code:**
<a class="ext-link" href="#">Google it</a>
या
<button class="ext-link" href="#">Google it</button>
(jQuery के साथ) जावास्क्रिप्ट मदद करता है:
//define tab or click event type on rool level (can be combined with modernizr)
iaEvent = "click";
if (typeof navigator !== "undefined" && navigator.app) {
iaEvent = "tap";
}
$('.ext-link').each.bind(iaEvent, function() {
if (typeof navigator !== "undefined" && navigator.app) {
// Mobile device.
var linktarget = this.attr("href");
navigator.app.loadUrl(linktarget, {openExternal: true});
} else {
// Possible web browser
window.open(linktarget, "_blank");
}
});
ऐसा लगता है कि यह डिफ़ॉल्ट रूप से एंड्रॉइड में ठीक काम करता है (लेकिन मैं क्रॉसवॉक प्लगइन का भी उपयोग कर रहा हूं ...)। वेबव्यू में '_self' खोलने के लिए मेरे 2015 के उत्तर की जांच करें, और बाहरी ब्राउज़र में '_blank': http://stackoverflow.com/questions/32208609/cordova-why-would-inappbrowser-plugin-be-required-to-open -लिंक्स-इन-सिस्टम-brows/32227524 –