R
R
Ruslan Leviev2013-01-08 15:30:03
JavaScript
Ruslan Leviev, 2013-01-08 15:30:03

IOS and JS "click" event?

Made a simple autocomplete on the site. We enter the first two letters of the word - a request is sent to the server, a list of results is returned, which is substituted as a “hint list”. The "list-hint" and the input field are not made in the form of a select-option tag, but a regular text input, under which there is an invisible div with hints.

As a result, under iOS, my autocomplete list is normally requested from the server, returned and displayed to the user. But, for some reason, in iOS, autocomplete items are not being clicked.

For me, the problem is aggravated by the fact that there is not a single iOS device at hand, so I can’t debug it, I can’t see the JS error console. The actual piece of code responsible for the “click” event on the autocomplete element:

$('#autocomplit p').live('click', function() {<br>
  city_name = $(this).html();<br>
  autocomplit.html('').css('display','none');<br>
  city.val(city_name);<br>
  <br>
  city_guid = $(this).data('guid');<br>
});<br>

I googled on the topic the features of DOM events and their interception on JS under iOS - as I understand it, the “click” event should also be processed normally.

So what's the problem, please?

Actually the page where the auto -complete is - there you select the administrative district near Moscow and start entering the name of the district (for example, Arbat).

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Paveldest, 2013-01-08
@ruskar

this is a bug 'live' override

E
egorinsk, 2013-01-08
@egorinsk

It seems that iOS devices do not allow clicking on all page elements, but only on links, elements with tabIndex and (possibly) elements with onclick. Instead of guessing on coffee grounds, I advise you to google the official document on the features of Safari in mobile devices on Apple's official website?

N
Nikita Gusakov, 2013-01-08
@hell0w0rd

jquerymobile.com/demos/1.2.0/docs/api/events.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question