jQuery – draggable images on iPad / iPhone – how to integrate event.preventDefault();?

Try this library https://github.com/furf/jquery-ui-touch-punch Just follow these simple steps to enable touch events in your jQuery UI app: Include jQuery and jQuery UI on your page. <script src=”http://code.jquery.com/jquery.min.js”></script> <script src=”http://code.jquery.com/ui/1.8.17/jquery-ui.min.js”></script> Include Touch Punch after jQuery UI and before its first use. Please note that if you are using jQuery UI’s components, Touch Punch must be … Read more

how to get value of selected item in autocomplete

When autocomplete changes a value, it fires a autocompletechange event, not the change event $(document).ready(function () { $(‘#tags’).on(‘autocompletechange change’, function () { $(‘#tagsname’).html(‘You selected: ‘ + this.value); }).change(); }); Demo: Fiddle Another solution is to use select event, because the change event is triggered only when the input is blurred $(document).ready(function () { $(‘#tags’).on(‘change’, function … Read more

jQuery Mobile/MVC: Getting the browser URL to change with RedirectToAction

I think I’ve found an answer. Buried deep in the jQuery Mobile documentation, there is information about setting the data-url on the div with data-role=”page”. When I do this, I get the nice jQuery Mobile AJAX stuff (page loading message, page transitions) AND I get the url in the browser updated correctly. Essentially, this is … Read more

Using pre-compiled templates with Handlebars.js (jQuery Mobile environment)

So after much trial and error (which is the best way to learn it) here’s the way that works for me. First- externalize all your templates, say you have a template inside script tags like <script id=”tmpl_ownevents” type=”text/templates”> {{#unless event}} <div class=”notfoundevents”><p>No events for you</p></div> {{/unless}} </script> Create a new file called events.tmpl and copy/paste … Read more

jQuery Mobile lock orientation

I have tried to modify manifest.xml and it works. Simply add android:screenOrientation=”landscape” attribute to your activity tag like below: <application android:icon=”@drawable/ic_launcher” android:label=”@string/app_name”> <activity android:label=”@string/app_name” android:name=”.Phonegap_AppName” android:configChanges=”orientation|keyboardHidden” android:screenOrientation=”landscape”> <intent-filter> <action android:name=”android.intent.action.MAIN” /> <category android:name=”android.intent.category.LAUNCHER” /> </intent-filter> </activity> </application>