use cfhttp in cfscript version

With the cfhttp Tag (Definition: „Generates an HTTP request and handles the response from the server“) you can easily get content from other URIs.
Here’s a short example how to use cfhttp inside in CFScript, that worked for me very well.
Please note that this example works properly with getting content from username / password protected URIs, too. I’ve tested my Code with Railo 3.3.1 final


//get cfhttp result
string function getCfHttpResult(required string targetUri="") output="false" access="private" hint="returns http result for a given uri" {
try {
http = new http();
http.setMethod("get");
http.setURL("#arguments.targetUri#");
http.setUsername("#getUsername()#");
http.setPassword("#getPassword()#");.
ret = http.send().getPrefix().FileContent;
}
catch (any e) {
ret = 0;
}
}

CSS3 substring matching

This sounds really interesting: there’s are some new attribute selectors in CSS3 which give you the power to select attributes for the patterns „begins with“, „ends with“ and „contains“.  For example you could use this technique to easily style a link list (internal links, mailto-links, external links…) with different icons.
I do not know something about the performance of these selectors but i assume you should be careful while using them. However, the Browser-Support is surprisingly good.

[att^=val] – „begins with“ attribute selector
[att$=val] – „ends with“ attribute selector
[att*=val] – „contains“ attribute selector

I recommend reading the whole article written by css3.info which you can find here: http://www.css3.info/preview/attribute-selectors/