Home » Javascript » Safari Browser From iOS Device Does Not Fire Java Script Function After Double Tap

Safari Browser From iOS Device Does Not Fire Java Script Function After Double Tap

Posted by: admin August 19, 2018 Leave a comment

Questions:

I am a newbie to Swift and JavaScript and I apologize for not being able to fully explain my question, but I hope someone can get me started in the right direction. My company uses an older Java Script driven website which creates dynamic tables that contain my work assignments. This website does not work well with an iOS device. Specifically, using Safari on an iOS device, if I select a table row that contains a work assignment and double tap the row, nothing happens. On a desktop, however, double clicking the assignment with a mouse will open a new browser window and I can view my assignment. Looking at the generated html, there is a table row element that looks like this:

<tr onclick="selectRow(event);" ondblclick="openPairingDetails(12345);">    

It appears that the “ondblclick= “ event is not firing when I double tap the selected row. I want to create an in-app browser using WebKit and hopefully be able to overcome this problem. Any suggestions would be appreciated. The ondblclick=”openPairingDetails(12345) is a javascript function that passes a unique parameter for each table row. Simply detecting a double tap event is not enough. The double tap function would then need to run the “openPairingDetails(12345) function with the given parameter. I would need to know how to parse out that parameter and pass it into the function each time a double tap was detected. I am hoping for an easier solution, or perhaps a more in-depth example.

Answers: