Archive

Posts Tagged ‘HTML’

How to fire event from javascript (Dynamic)

August 13, 2010 Leave a comment

I had a requirement to call onchange event of a select box (combo box) from JavaScript and the function has an input param as event. I found one article which helped me to achieve this for one of my clients mobile web site (Land Rover UK), when I was working at www.2ndbyte.com.

The article link is Firing Javascript Events (like onchange)

Here is the code which I had to change a little bit to fit in my code:

function fireEvent(element,event){
if (document.createEventObject){
// dispatch for IE
var evt = document.createEventObject();
return element.fireEvent('on'+event,evt)
}
else{
// dispatch for firefox + others
var evt = document.createEvent("HTMLEvents");
evt.initEvent(event, true, true ); // event type,bubbling,cancelable
return !element.dispatchEvent(evt);
}
}

Here is the code for how to call this method:

fireEvent(obj,’change’);

Thanks to Jehiah

Categories: Browser, HTML, JavaScript Tags: , ,

iPhone – Mobile web site

July 27, 2010 Leave a comment

I had requirement to show number keyboard when on iPhone and user clicks on phone number input box and found this article which is very helpful and informative:
Thanks to Ben Nadel:

Link

Another link which could be helpful, which I found on the above blog was from Raymond Camden.

Apple Docs on iPhone specific Safari web content

And third link for iPhopne HTML5 stuff, about storing large quantity of data on client side

Link

HTML5 documentation on W3C Docs

Categories: HTML, iPhone Tags: ,