It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Partner Sites
Board index Programming Java Forum

Validation Errors

Validation Errors

Postby bouldercitywebdesign on Wed Oct 10, 2007 8:49 pm

Hi all, and thanks up front if anyone can help.
I am doing some SEO work for a client, and as part of that, I am validating some pages.
On their front page, they have javascript to detect OS's & flash version for a flash.
In this code, I am coming up with validation errors, and would like to know if it is ok to cut/delete the extra ampersand before the isWin and IsOpera below...

(i know very little about javascript)

(it appears in many places and the extra ampersand is triggering the code error)

Code: Select all
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
   reqVer = parseFloat(reqMajorVer + "." + reqRevision);
      // loop backwards through the versions until we find the newest version   
   for (i=25;i>0;i--) {
      if (isIE && isWin && !isOpera) {
         versionStr = VBGetSwfVer(i);
      } else {
         versionStr = JSGetSwfVer(i);      
      }
      if (versionStr == -1 ) {
         return false;
      } else if (versionStr != 0) {
         if(isIE && isWin && !isOpera) {
            tempArray         = versionStr.split(" ");
            tempString        = tempArray[1];
            versionArray      = tempString .split(",");            
         } else {
            versionArray      = versionStr.split(".");
         }
         versionMajor      = versionArray[0];
         versionMinor      = versionArray[1];
         versionRevision   = versionArray[2];
         
         versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
         versionNum        = parseFloat(versionString);
           // is the major.revision >= requested major.revision AND the minor version >= requested minor
         if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
            return true;
         } else {
            return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );   
         }
      }
   }   
   return (reqVer ? false : 0.0);
}
bouldercitywebdesign
 
Posts: 3
Joined: Wed Oct 10, 2007 8:37 pm

Return to Java Forum

Who is online

Users browsing this forum: No registered users and 0 guests