From: Brad C. <yo...@br...> - 2005-03-02 16:20:52
|
The WARNING is harmless but suggests that your system does not have a mime type setup for the .js file extension. For file URLs we pass off content type interpretation to java which should query whatever method your OS uses to keep up with that kind of thing. The SEVERE is a syntax error in your javascript file. --- nikola <web...@ya...> wrote: > hi, I have problem including external javascript file > here is the code: > > String js_1 = > "file://D:/FoxServ/www/app/javascript/main.js"; > > final String content = > "<html><head><title>aaa</title>" > > +"<script language=\"JavaScript\" src=" + js_1 +" > type=\"text/javascript\"></script>" > > ... > when I load the page > > final HtmlPage page = loadPage(content); > > I get this error: > > 2005.03.02 09:43:16 > com.gargoylesoftware.htmlunit.html.HtmlPage > loadJavaScriptFromUrl > WARNING: Expected content type of text/javascript or > application/x-javascript for remotely loaded > javascript element > file://D:/FoxServ/www/app/javascript/main.js but got > [text/html] > 2005.03.02 09:43:16 > com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter > error > SEVERE: error: message=[syntax error] > sourceName=[file://D:/FoxServ/www/app/javascript/main.js] > > what am I doing wrong ? > thanks ... |