When loading local javascript (file://), lot of warnings appear:
WARN com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl - Obsolete content type encountered: 'text/javascript'.
this is because com.gargoylesoftware.htmlunit.WebClient.guessContentType returns "text/javascript" for .js files.
HtmlPage.loadJavaScriptFromUrl checks contenttype just after receiving the response, so the warning.
Proposed fix:
return "application/javascript" for .js files in guessContentType
Good point :-)
Fixed in SVN; a fresh build will be available on our CI build server shortly.
Will inform via twitter (www.twitter.com/htmlunit) if a new snapshot build is in the repos.
Many thanks for your report, enjoy using HtmlUnit.