Javascript date parsing on Iphone

Not all browsers support the same date formats. The best approach is to split the string on the separator characters (-,   and 🙂 instead, and pass each of the resulting array items to the Date constructor: var arr = “2010-03-15 10:30:00”.split(/[- :]/), date = new Date(arr[0], arr[1]-1, arr[2], arr[3], arr[4], arr[5]); console.log(date); //-> Mon … Read more

Meta Tag “apple-mobile-web-app-capable” for Android?

Chrome on Android now supports a meta-tag mobile-web-app-capable: Since Chrome M31, you can set up your web app to have an application shortcut icon added to a device’s homescreen, and have the app launch in full-screen “app mode” using Chrome for Android’s “Add to homescreen” menu item. For details about the mobile-web-app-capable meta-tag, scroll down … Read more

How to make bevel and Embosed effect to button in CSS 3 for web-kit based browsers?

This is possible without the use of extra mark-up through the use of multiple box-shadows: box-shadow: 0 1px 2px #fff, /*bottom external highlight*/ 0 -1px 1px #666, /*top external shadow*/ inset 0 -1px 1px rgba(0,0,0,0.5), /*bottom internal shadow*/ inset 0 1px 1px rgba(255,255,255,0.8); /*top internal highlight*/ http://jsfiddle.net/NPXfe/

iPad/iPhone browser crashing when loading images in Javascript

Update: I think there’s an even easier way to do this, depending on your application. Instead of having multiple images, if you simply have one <img> element or Image object (or maybe two, like a ‘this’ image and a ‘next’ image if you need animations or transitions) and simply update the .src, .width, .height and … Read more

Disabling user selection in UIWebView

Here are a few ways to disable selection: Add the following to your mobile web documents <style type=”text/css”> * { -webkit-touch-callout: none; -webkit-user-select: none; /* Disable selection/copy in UIWebView */ } </style> Programmatically load the following Javascript code: NSString * jsCallBack = @”window.getSelection().removeAllRanges();”; [webView stringByEvaluatingJavaScriptFromString:jsCallBack]; Disable the Copy / Paste user menu: – (BOOL)canPerformAction:(SEL)action withSender:(id)sender … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)