N
N
Nikita Shchypylov2016-09-27 22:56:03
PHP
Nikita Shchypylov, 2016-09-27 22:56:03

What may not work in this function in mobile browsers and Safari?

There is such a function:

function deleteNotes() {
  var deleteBtn = document.getElementById('reset_notes');
  deleteBtn.addEventListener('click', function (e) {
    e.preventDefault();
    localStorage.clear();
    location.reload();
  })
}

On desktops, everything works as it should (clears localStorage and refreshes the page), but on the iPad it does not work. Also does not work in Safari on desktop. Why?

UPADTE:
In general, even I started testing and it doesn't work anywhere else, like in Chrome. Is there something crooked here?
Thanks

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ivanq, 2016-09-27
@Ivanq

foreach should be for tr:

<html>
  <head>
    <title>Парсинг...</title>
  </head>
  <body>
    <table  border="2px";>
      <?php
        $dir=$_POST['load'];
        if (is_dir($dir)) {
           foreach (glob($dir . '/*') as $file) {
      ?>
      <tr>
        <td>
          <?php echo $file; ?>
        </td>
        <td>
          <?php 
            $filestring = file_get_contents($file);
            preg_match('~-x(.*)-c~Uis', $filestring, $result);
            echo $result[1];
          ?>
        </td>
      </tr>
      <?php } } ?>
    </table>
  </body>
</html>

D
Dima Pautov, 2016-09-27
@bootd

What about local storage?
Try like this:
location.reload(true);

N
nd0ut, 2016-09-27
@nd0ut

deleteBtn.addEventListener('click touchstart', ...)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question