addAsset not recognising js url with querystring

Hi

If I try to addAsset("common.js?v=1.1") it's wrongly recognised as a
css instead of js. Suggest the following change:

          if( listLast(listFirst(thisAsset, "?"),".") eq "js" )
{ <<<<<<<<<<<<<<< line changed
            sb.append('<script src="#thisAsset#" type="text/javascript"></

');

          }
          else{
            sb.append('<link href="#thisAsset#" type="text/css"
rel="stylesheet" />');
          }

Cheers
Nick

Is the v=1.1 just used to flush the asset from the cache? If so, what about adding a param to addAsset that allows you to add a custom var to append such as ?v=1.1. This could be user specified.

Nolan Dubeau

Load *.*,8,1

Hmm.. don't really see the benefit in an extra parameter for query
strings. I think we should instead add a "type" param, with "js" and
"css" as possible values. That way we remove the restriction on how an
asset is named, so that we could for eg do this:

addAsset("somedynamicallygeneratedjs.cfm", "js")

The bottom line however, is we always have $htmlhead(...) to fall back
on, so this is super low priority stuff in any case =)

Nick

Yeah, that makes more sense.

Nolan Dubeau

Load *.*,8,1