#11206 closed bug (worksforme)
jQuery 1.6.2 and greater is not supported on Safari on iPhone
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hi, I've had to roll back to version 1.4.2 to get simple jQuery functions working on an iPhone.
When testing on 1.6.2 and the latest release 1.7.1, even a simple alert does not work. I half suspect this is as designed (so as to promote jQuery mobile), but as I can't find any documentation I thought I'd let you know.
Regards
Change History (6)
comment:1 Changed 12 years ago by
Owner: | set to andrew.harland@… |
---|---|
Status: | new → pending |
comment:2 Changed 12 years ago by
Status: | pending → new |
---|
It was tested on a 3GS and iPhone 4 (not 4S).
No, I didn't test using JQM. The original script was a slideshow, which I reduced to a simple alert for debugging:
<script type="text/javascript" src="scripts/jquery-1.6.2.min.js"></script> // worked on all desktop browsers and android, but not on iPhone <script type="text/javascript"> $(document).ready(function() { alert('jQuery alert'); }); </script> // worked on all browsers and iPhone <script type="text/javascript"> alert('JavaScript alert'); </script>
comment:3 Changed 12 years ago by
Tried it on my iPhone 3GS with iOS 5 and iPhone simulator with iOS 4, and I got both alerts.
It seems the issue is with your iPhone or your development setup.
- sindresorhus
comment:4 Changed 12 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
I also tested this on my iPhone 4S - no issues.
comment:5 Changed 11 years ago by
I am having a very similar issue. Two iphone 4 gives different results.
I wish I could provide some information that would help reproduce the problem but... I do not know why it's behaving like this.
I made a very simple html file based on the code provided by andrew.harland and I did not get the alert on my iPhone 4 but my friend was getting it. I simply changed the <script> line to load the jquery from google hosted apis and I was able to get the alert.
It is worth to note that the local file came from the google hosted version.
Using local file (copy of google's) | Referencing google's version directly | |
My iphone: | no alert | alert |
My friend's: | alert | alert |
<script src="jquery-1.6.2.min.js"></script>
vs.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
I tried multiple things like specifying the full URL on my local file and I tried specifying http: on the google one. Always same results.
I also cleared cache on my iphone and restarted it. Same results.
comment:6 Changed 11 years ago by
It's not an issue with jQuery on iPhone. The issue is with the network (in this case O2) compressing/optimising scripts and making then unworkable. There's some discussion on the O2 forum pages about this but it's tricky to locate, but as I gather there is some code to include that tells O2 not to compress the JS. The alternative is just to link directly to a CDN hosted version.
We just need a few things before we can investigate.
Also, if you can't find any documentation, it's best to first ask for help on http://forum.jquery.com or Stackoverflow to ensure you haven't missed something.