Announcement

Collapse
No announcement yet.

Alternate to CGI Redirection for drop-down list box javascripts

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Alternate to CGI Redirection for drop-down list box javascripts

    Hi all,

    I'm having a problem where my search scripts are redirecting to the root of the site instead of the acatalog directory using a javascript derived from the drop-down list box javascripts in the advanced user guide.

    Unfortunately this project is very near completion and the client wants to see a demo, so I 'knocked up' the following javascript:

    Code:
      var re = /^(.*)\?SECTIONID=/;
      var uridec = decodeURI (ar[i].sURL);
      uridec = uridec.replace (re, "");
      re = /&NOLOGIN=1$/;
      uridec = uridec.replace (re, "");
      var thispage = location.href;
      re = /index\.html$/;
      thispage = thispage.replace (re, "");
      re = /\/acatalog/;
      if (!re.test (thispage)) {
        uridec = "acatalog/" + uridec;
      }
    This takes the long cgi url (from the Act_Sections.js file) and converts it to a short direct url.

    Yes, it may be a bit messy, but my javascript is a little rusty, so I tend to do things a bit of a longer way round, but it works

    Javascript is such an awful language - it's far too easy to get it wrong (but still have it sort of work) and far too laborious to get right.

    I've run this through both Mozilla 1.2.1 & IE 5.5 SP2 with no errors.

    Allen
Working...
X