Phone links do not work inside the iframe, although it works in a div on the iOS9 network. How to make phone links work in iOS9 safari?

Hi, I tried using phone links inside an iframe in iOS9. Phone application does not open in safari in iOS9. When I tried the same link inside, it works there.

I tried to substitute the anchor tag. This code opens the phone application when it is placed inside a div. But the same code does not work inside the iframe. Please suggest how to do this to work inside an iframe?

Please use the code below to see the phone link outside the iframe

<a href = "tel://1-408-555-5555">1-408-555-5555</a>

Please use the code below to confirm the telephone connection inside the iframe.

<iframe  id = "test" style = "border:none;"></iframe>
<script>
var iframe = document.getElementById("test");
var iDoc = iframe.contentDocument;
iDoc.write('<a href = "tel://1-408-555-5555">1-408-555-5555</a>');
</script>
+4
1

, . target = "_ parent", Links Safari iOS9.

<iframe  id = "test" style = "border:none;"></iframe>
<script>
var iframe = document.getElementById("test");
var iDoc = iframe.contentDocument;
iDoc.write('<a target="_parent" href = "tel://1-408-555-5555">1-408-555-5555</a>');
</script>
+8

Source: https://habr.com/ru/post/1613151/


All Articles