Tuesday, October 23, 2007

In search of Flex source code...

http://www.google.com/search?hl=en&lr=&q=inurl%3A%22%2Fsrcview%2Fsource%2F%22&btnG=Search

or in Google search box:
inurl:"/srcview/source/"

Tuesday, October 02, 2007

function domainCheck(url:String, domain:String) {
return url.indexOf(domain) != -1;
}

What's wrong with the above code, which attempts to check if url contains domain?


Answer: if url is undefined, indexOf returns undefined instead of -1.