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

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Validation Errors

Validation Errors

Postby bouldercitywebdesign on Wed Oct 10, 2007 7:51 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 7:37 pm

Postby bobbyblades on Thu Oct 11, 2007 7:18 am

thats a logical AND operator and it's there for a reason so that can't be the problem, if you remove one of the ampersands it becomes a bitwise operator
which would really create havoc in the code
User avatar
bobbyblades
50+ Club
 
Posts: 85
Joined: Fri Aug 24, 2007 8:38 pm
Location: hawaii or bust

Postby bouldercitywebdesign on Thu Oct 11, 2007 7:29 pm

thank you for the reply.
I just replaced the script with a much simpler one.
bouldercitywebdesign
 
Posts: 3
Joined: Wed Oct 10, 2007 7:37 pm


Who is online

Users browsing this forum: No registered users and 6 guests