Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#8917 closed bug (wontfix)

jQuery not loading over 3g or Edge on 02 network .

Reported by: arobinson@… Owned by:
Priority: low Milestone: 1.next
Component: web Version: 1.5.2
Keywords: dbr Cc:
Blocked by: Blocking:



I work for Reapit Ltd a UK based company that is a market leader in Estate Agency software. I am currently tasked with creating a Web Application for the iPhone.

A few months back I came across an issue with JavaScript files not loading correctly and throwing seemingly random syntax errors. The issue was only happening when the iPhone was using a 3g or Edge connection. After some research into the issue I found that 02 (UK network provider) seems to be screwing around with JavaScript in an attempt to optimize load times. Check these articles out:



Its a very frustrating issue. I systematically eliminated all the js files I load and have found that the more recent versions of the jQuery library will not work regardless of being minified or not.

The last version that I know works for me is 1.4.4. I was just interested to see if anyone else has had this issue as it has had me pulling my hair out. I havent been able to test on other networks but have tested all versions of the iphone and I get the same issue.

I havent had time to try and work on a fix, as the article states, the syntax error can be different depending on the load times of the 02 proxy servers.



Change History (12)

comment:1 Changed 6 years ago by addyosmani

Priority: undecidedlow
Resolution: wontfix
Status: newclosed

Thanks for submitting a ticket to the jQuery Bug Tracker. Please note the following from the SO thread you referenced:

I've investigated this further and discovered that the problem is that the UK mobile operator O2 (the original exclusive iPhone operator for Apple), modifies web content before sending it to iPhones and iPads. Probably before sending it to any device running a mobile browser.

Unfortunately, we are unable to modify jQuery to work around situations where third parties may apply filtering or otherwise modify the code/usage/inclusion of the code as a part of their distribution process. Where this is a concern, it's recommended that you contact O2/the mobile operator directly and attempt to have them resolve this. It may assist by providing a summary of why a fix is necessary (the content you submitted in your ticket would probably suffice).

comment:2 Changed 6 years ago by anonymous

I have the same issue with my provider (T-Mobile) in Holland and an iPhone website. Seems to work in Wifi mode, doesn't load JQUERY in 3G mode. Temporarily fixed it by downgrading to 1.4.4 but that doesn't sound like a good option!

comment:3 Changed 6 years ago by anonymous

Same here also with Vodafone NL

strange thing is, if you use http://code.jquery.com/jquery-1.5.min.js

also, if you look at the source you'll see that the comments aren't stripped

comment:4 Changed 6 years ago by Rick Waldron

Component: unfiledweb

Yes, the comments are stripped, however the header is left in tact.

comment:5 Changed 6 years ago by Holger

Well, at least for T-Mobile in Germany my colleagues and I have found a way around this: As T-Mobile seems to omit JavaScript files that are in the same (sub-)folder on the webserver when loading a webpage you have two options:

Solution 1: Put jQuery file in a different (higher level) folder, e.g. mydomain.com/mobileapp/index.html and mydomain.com/script/jquery.js


Solution 2: Use the CDN hosted version of jQuery (as this is on a different server). http://docs.jquery.com/Downloading_jQuery#CDN_Hosted_jQuery

We've tested this with multiple devices and providers. Seems that only T-Mobile does that crap (thanks a lot) and both solutions worked in all cases on all devices (with all 4 German providers) we tested.

comment:6 Changed 6 years ago by ppumkin@…

I ran into the same issue with O2 in UK. If i view the source it of the page it merges all the javascript/css into the head of the html.. which I assumes is to speed up the loading. But this does stop jquery from working correctly. I by default always layer my scripts and css into different directories. So.. the post by Holger on solution one did not work by default in UK.. I will still try to add the CDN and see what happens.

This only happens if i use 3G tethered via Bluetooth. So i think the site thinks i am actually using some old Nokia to try and view the site and strips stuff out. If i use the proper HSDPA Huwaie Dongle it does not do this.

I think there needs to be something added to the head of the file to stop these services from compressing/stripping or modifying content. I am just not sure what it would be.

comment:7 Changed 6 years ago by jorritdeklerk

Had this with T-Mobile NL. Everything was working fine on server A (with local jQuery files) until I put my WebApp on a server B. Server A was using SSL, server B was not.

So when it's SSL the provider cannot 'optimize' the files (logically, because the provider cannot look into the files) so everything keeps working.

So, SSL can be a 'workaround'.

For server B I now use the CDN hosted files and this works.

comment:8 Changed 5 years ago by marcin@…

We've had this error on iPhone 4: "SyntaxError: Parse error" and then changing the link to CDN one fixed it on our end. Thanks for the tip!

comment:9 Changed 5 years ago by anonymous

Just so anyone visiting this thread still hasn't found the answer to solving this. Here it is:

Just set your Response Header from your server to include: Cache-Control:no-transform

Here's kudos to how I discovered this: http://stuartroebuck.blogspot.co.uk/2010/08/official-way-to-bypassing-data.html

and the stackoverflow question: http://stackoverflow.com/questions/3282373/web-site-exhibits-javascript-error-on-ipad-iphone-under-3g-but-not-under-wifi

comment:10 Changed 5 years ago by anonymous

We've had this issue on the iPad in the UK, thanks for these posts as switching to linking to the CDN hosted files fixed the problem.

comment:11 Changed 4 years ago by anonymous

Comment-Bug in jquery.themepunsh.revolution.js prohibit js-compression using mobile connections!!! line 1885!!!

comment:12 Changed 4 years ago by mikesherov

Keywords: dbr added
Note: See TracTickets for help on using tickets.