Bug Tracker

Opened 16 years ago

Closed 15 years ago

#946 closed enhancement (wontfix)

Occurrence of // in strings in jquery.js causes problems with idiotic JS-filters

Reported by: [email protected] Owned by:
Priority: major Milestone: 1.2.4
Component: core Version:
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by flesler)

Some German cell-phone internet providers obviously employ absolutely stupid transparent proxies which filter .js Files to decrease the download size and seem to cut off everything in JS sources after . jQuery's XPath Code contains the following line:

if ( !t.indexOf("") ) {

I wonder if this could maybe be rewritten to something like

if( !t.indexOf("/"+"/")) {

or maybe

if( !t.indexOf("")) {

(I know, this is strictly speaking not a problem in jQuery itself, but it would be an easy work-around to not trigger such a filter. We already told the affected users to contact the cell phone provider, but it's not clear whether this will help)

Change History (3)

comment:1 Changed 16 years ago by warp

The problem is worse than originally thought. Not only E-Plus filters Javascript this way, also Vodafone Germany does it.

Also, at least one other part of jQuery which is affected is the IE script defer hack:

document.write("<scr" + "ipt id=ie_init defer=true " +


Changing src=: to src= seems to work around the problems.

This should _really_ be fixed in the standard distribution, especially as it's an easy to use fix which will avoid problems for many people.

comment:2 Changed 15 years ago by Eli-D

Worthy to note, the defer hack is no longer used in bindReady().

The only instance of "" I found is in ajax():

// If we're requesting a remote document
// and trying to load JSON or Script with a GET
if ( (!s.url.indexOf("http") || !s.url.indexOf("//")) && ( s.dataType == "script" || s.dataType =="json" ) && s.type.toLowerCase() == "get" ) {

comment:3 Changed 15 years ago by flesler

Description: modified (diff)
Milestone: 1.2.4
need: Review
Resolution: wontfix
Status: newclosed

The ajax case is now gone, a regex is used which has a: '...\/\/...'. As for the XPath, it's no longer supported.

This seems to be accidentally fixed. Please reopen if you another occurrence of and we'll see how to deal with it.

Note: See TracTickets for help on using tickets.