Page 1 of 1

javascript puzzle

Posted: Wed Apr 30, 2008 7:52 am
by roedygr
The beta complains about his code, saying it is missing a semicolon. I can't see what the trouble is.

<script language="javascript" type="text/javascript">
<!--
var jwsinstalled = 0;
var tryIE = "false";
if ( navigator.mimeTypes && navigator.mimeTypes.length && navigator.mimeTypes[ 'application/x-java-jnlp-file' ] ) jwsinstalled = 1;
else tryIE = "true";
// -->
</script>
<script language="vbscript" type="text/vbscript">
<!--
on error resume next
if tryIE = "true" Then
if IsObject(CreateObject( "JavaWebStart.isInstalled" )) Then
jwsinstalled = 1
end If
end If
// -->
</script>
<script language="javascript" type="text/javascript">
<!--
if ( jwsinstalled )
document.write( "Your browser appears to be already configured properly for Java Web Start." );
else document.write( '<span class="important">Your browser is <i>not</i> configured properly for Java Web Start *.jnlp and application/x-java-jnlp-file MIME types! Click to learn how to <a class="button" href="installingjaws.html">Repair</a> the damage.</span>' );
// -->
</script>

Posted: Wed Apr 30, 2008 9:50 am
by Albert Wiersch
Thanks. I will pass this along to the develop of the JavaScript linter. I think it may be an issue with it trying to check VBScript.

Here is the linter that CSE HTML Validator v9.0 integrates with for linting JavaScript:
http://javascriptlint.com/index.htm

Posted: Wed Apr 30, 2008 12:54 pm
by Albert Wiersch
I received a response about this:
Matthias Miller wrote:Ideally, JavaScript Lint would ignore VBScript. However, it's nontrivial to fix, although I would accept patches for it. I've been doing some work to make JavaScript Lint more extensible in the future, but since this is only a side project, it doesn't get full-time attention.

If I think of any good solutions, I'll let you know.

Posted: Wed Apr 30, 2008 3:33 pm
by roedygr
Matthias Miller wrote:Ideally, JavaScript Lint would ignore VBScript. However, it's nontrivial to fix,
I find that odd. You have the enclosing tag
<script language="vbscript" type="text/vbscript">
to tell you vbscript not javascript is coming up.
It is not as though you have to tell vbscript apart from javascript just by looking at the code.

Posted: Wed Apr 30, 2008 3:48 pm
by Albert Wiersch
roedygr wrote:
Matthias Miller wrote:Ideally, JavaScript Lint would ignore VBScript. However, it's nontrivial to fix,
I find that odd. You have the enclosing tag
<script language="vbscript" type="text/vbscript">
to tell you vbscript not javascript is coming up.
It is not as though you have to tell vbscript apart from javascript just by looking at the code.
I find it a little odd too but I don't know the design details of JavaScript Lint. You can turn JavaScript linting off in the Validator Engine Options if you are not interested in it or if it is generating too many false messages because it's trying to check VBScript.