Safari mobile ignores default prevention

I use e.preventdefault () for the link that is in the info window on google maps.

It works as expected on the desktop where the link does not visit href, but on safari it seems to ignore it and visits the link as if javascript were not loading.

This explicitly loads javascript, because google maps along with a lot of markers and info windows load fine.

Link Code:

$('.infowindow .more, .infowindow h3 a').live('click', function(e) { e.preventDefault(); /* Loading content from external html file */ $('#content .content').html('<p class="loading"><img src="images/icons/loader.gif" alt="Loading content..."></p>'); $('#content .content').load($(this).attr('href') + ' #content > *', function() { 

Obviously, the code here continues with other bits and beans.

Does anyone else have any problems or does he know a solution for this?

thanks

Dave

+4
source share
1 answer

Instead of using

 e.preventDefault(); 

add at the end of this function

 return false; 

Then clicking the <a> element will not be redirected anywhere.

0
source

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


All Articles