Javascript false errors

For topics about current or future BETA releases, including feature requests.

Javascript false errors

Postby roedygr » Mon Aug 25, 2008 9:19 pm

I think I mentioned this before: this code fails validation because HTML validator mistakes VBScript for Javascript.

<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>
<!-- check IE, using vbscript NOT javascript --><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>
<!-- generate corresponding message using JavaScript --><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="installingJWS.html">Repair</a> the damage.</span>' );
// --></script>
User avatar
roedygr
Rank V - Professional
Rank V - Professional
 
Posts: 242
Joined: Fri Feb 17, 2006 6:22 am
Location: Victoria BC Canada

Postby Albert Wiersch » Mon Aug 25, 2008 10:09 pm

Yes, this seems to be a limitation with JavaScript Lint. It seems to check VBScript as JavaScript. The developer of JavaScript Lint said that it was a non-trivial fix so I'm not sure if it will be addressed. Unfortunately this is not under my control. :(

There may be a workaround I could do myself, but I don't think it would be worth the effort.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2361
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Postby roedygr » Tue Aug 26, 2008 2:51 am

I strongly doubt it is a big deal in this particular case since the VB code is clearly delimited with
<script language="vbscript" type="text/vbscript">

I suspect your fellow is confused and imagines he has to examine the code and decide if its VBSCRIPT or JAVASCRIPT, a non-trivial problem.
Make sure he understands that he has that sandwich to go on.
User avatar
roedygr
Rank V - Professional
Rank V - Professional
 
Posts: 242
Joined: Fri Feb 17, 2006 6:22 am
Location: Victoria BC Canada

Postby Albert Wiersch » Tue Aug 26, 2008 9:42 am

roedygr wrote:I suspect your fellow is confused and imagines he has to examine the code and decide if its VBSCRIPT or JAVASCRIPT, a non-trivial problem.
Make sure he understands that he has that sandwich to go on.


I suspect he understands that and I have pointed him to this thread. It does seem like it wouldn't be that difficult since it is indeed marked as VBScript, but I didn't write JavaScript Lint. :D
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2361
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX


Return to CSE BETA Talk

Who is online

Users browsing this forum: No registered users and 1 guest