YUILibrary - Open source JavaScript and CSS for building richly interactive software.
Fork YUI on GitHub

YUI 2.x

Ticket #2528680 (accepted defect)

Reporter


Kaven Yan
Opened: 03/5/10
Last modified: 07/7/10
Status: accepted
Type: defect

Owner


Adam Moore
Target Release: FUTURE
Priority: P5 (trivial)
Summary: & is in the tail of combo url
Description:

If you write:


YUI({combine:true}).use('console','node',function(Y){
var url = Y.Node.one('link[id]').getAttribute('href'),
con = new Y.Console();
con.render();
Y.log(url);
});

You Will Get External Style Combo Url in Head Element:
http://yui.yahooapis.com/combo?3.1.0pr1/build/widget/assets/skins/sam/widget.css&3.1.0pr1/build/console/assets/skins/sam/console.css&

& is in the tail of the url, it is out of place.

demo is http://dancewithnet.com/lab/yui/bug/3.1.0pr1/combo-bug/

I simply fixed the bug in loader.js


//fixed combo bug
if(url.slice(-3) ==='.js' || url.slice(-4) === '.css'){
url += '&';
}

url += frag;

/*
if (i < (len - 1)) {
url += '&';
}
*/

demo is http://dancewithnet.com/lab/yui/bug/3.1.0pr1/combo-bug/fixed.html

Type: defect Observed in Version: 3.1.0 PR1
Component: Loader Severity: S3 (normal)
Assigned To: Adam Moore Target Release: FUTURE
Location: Library Code Priority: P5 (trivial)
Tags: loader combo Relates To:
Browsers: All
URL: http://dancewithnet.com/lab/yui/bug/3.1.0pr1/combo-bug/
Test Information:

Change History

Adam Moore

YUI Developer

Posted: 03/10/10
  • location changed to Library Code
  • milestone changed to FUTURE
  • priority changed to P5 (trivial)
  • status changed from new to accepted

Marked for post GA -- the trailing ampersand has no effect.

George

YUI Developer

Posted: 03/12/10
  • version changed from 3.1.0PR1 to 3.1.0 PR1

trevorhartsell

Posted: 04/2/10

It can affect caching in certain situations. I happened to have a configuration that was requesting a URL with an ampersand on one page and without an ampersand on another. (But for the life of me, I can't remember why...)