Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Issues pertaining to specific browsers


Guest

Recommended Posts

Hello,

 

I am supporting an older version of osCommerce (2.2-MS2) and have discovered an issue with Internet Explorer that I'm relatively sure everyone else knows, but on the off chance that they don't....

 

index.php has a function to redirect a page based on the location variable.  The code itself in my version of index.php (using 'mydomain' in place of the live domain): 

function redirect($location)  {
        $location = trim($location);
        echo "<SCRIPT LANGUAGE=\"JavaScript\">document.location.replace('https://mydomain.com/".$location."');return;</SCRIPT>;
        exit;
       }

 I'm guessing this is in place to avoid being able to hit the 'back' arrow on the browser, as my reading shows me the method allows us to not keep history on this page.  Anyway, Internet Explorer (doesn't matter which version) would hit this code at the point where we were trying to get to the product_info.php page and simply churn...and churn...and churn...

 

Turns out that this portion of the code:

<SCRIPT LANGUAGE=\"JavaScript\">

really needs to be:

<SCRIPT>

simply because Internet Explorer appears to not understand javascript, and instead uses it's own version called jscript (as Microsoft needs to feel special, imho).

 

I don't know if this function is an original part of osCommerce, or if this is a hack done by someone not in my employ, but I thought it interesting enough to post.

 

Cheers!

Link to comment
Share on other sites

I would be very surprised if IE started failing because of language="javascript". It's always been tolerant of a JavaScript specification, even though its own implementation is a slightly different jscript (the generic name of the browser programming language is ecmascript). In any case, these days the preferred method is to use type="text/javascript" or "text/ecmascript" (application can be used instead of text). Javascript is supposed to be the default. If an attribute (such as language= ) is not supported or understood, that attribute should be simply ignored. I suspect that something else is going on with the browser you're using (such as its configuration).

 

By the way, 2.2 MS2 is positively ancient. You should be spending your time looking at migrating to 2.3.4, rather than trying to patch up such an old store to work with modern PHP levels etc.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...