Safari mobile browser doesn't have selectedOptions for <select> - javascript

I am working on a web app and was testing it on my ipad when I realized that something was not working.
I decided to further look into it and discovered that this won't work on the ipad but will on desktop browser:
$(function() {
$('select').change(function(e) {
console.log(e.srcElement.selectedOptions);
});
});​
Ipad console shows undefined
Here is a jsfiddle to test it out with.
Is my approach wrong? Or is this a bug in mobile safari?

Do you mean to be using e.srcElement.selectedIndex or e.srcElement.value?
e.srcElement.options[e.srcElement.selectedIndex].getAttribute("data-sort");

Related

swiper not working on latest version of chrome (70)

I am trying to get swiper to work. I have tried it on edge and firefox and it seems to work. However it doesnt work on chrome.
To reproduce, visit http://idangero.us/swiper/demos/ using chrome and select the first demo, try swiping, it doesnt swipe. There is nothing n the console to suggest any scripting errors. This did used to work in chrome, so my guess is that an update in chrome has caused it to fail.
Does anyone have a fix or a workaround?
It seems to be fine in Edge and firefox....
Same here !
Chrome 70 supresses touch events on desktops :
"ontouch* members on window, document, and element are disabled by default on desktop devices"
https://www.chromestatus.com/feature/4764225348042752
Any workarounds ?
btw , "slick" swiper (http://kenwheeler.github.io/slick/) seems to be working well with touch

JS doesn't work on Safari on mobile devices only, can't replicate in Safari Console

Looking for ideas on how to debug instances where JS doesn't work on Safari mobile, works fine on desktop, and then in desktop when I open the Safari console and run the page again using Safari-iOS 9.3-iPhone (which is the version people have had issues on) on a mobile screen it still is working fine.
Thanks!
use can use safari remote debug, you can find a detail steps online

document.getElementById working differently on iPad Safari?

I'm getting completely different behaviors in mobile Safari on the iPhone versus the iPad, both on actual hardware and in the iOS simulator, for document.getElementById.
This works on mobile and desktop but not on the iPad:
var foo = document.getElementById('foo');
foo.innerHTML = 'bar';
Actually, setting foo.[anything] isn't working on the iPad.
Website: https://davero.com/order2
Banging my head bloody. All help will be appreciated.
Are you using safari on the desktop to? Safari has had a problem before where it will return null or undefined back instead of the object.
Try using jQuery instead which would look like $('foo');
It would also be really helpful if you could post your code or atleast where you tagged foo and your script.

Jquery sliding DIV not working in browser compatibility issue

I am trying to implement a sliding div over pdf (Information : Pdf is Shown using iFrame). Its working on Mozilla Firefox, Chrome but its not working on Internet Explorer, Safari :(. Here is the jsFiddler Link. Click Here
Will any 1 let me know what should i do to work in all browsers.
try this tutorial
http://www.learningjquery.com/2009/02/slide-elements-in-different-directions
I think decent css is the key here

jQuery not working in Safari

I've got this jquery script, it seems to be working in other browser, but it doesnt work at all in Safari. Does anyone know why this might be happening? Its supposed to be accessed from an iphone.
url: http://connectsr.org.nz/calendar/
thanks
in safari 5 on windows 7 this works, but not with my iphone (iphone 4 with newest ios, not jailbreaked). i think this is because if you click and drag to scroll the colums, the safari on the iphone tries to scroll the site (which is what it normally does when you klick and drag on a website)
Jquery script is not working on the mobile perfectly. Instead of jquery, you can use jquery mobile (http://jquerymobile.com/)

Categories

Resources