SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Web Genius
    Join Date
    Nov 2001
    Location
    Canada
    Posts
    708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Help changing relative to absolute please

    Ok this was a pre-made peice of javascript that I need to change. It expects all the files are in the same dir as this script but in fact they're not.

    I need to change the address to: http://www.ramprage.com/ <-- allfileshere :-) from the old path with thinks everythign is inside the same dir as this file.

    Could soemone please modify this for me, I have no idea what I'm doing.

    q18=0;q19=new Array();dh=DQM_divider_height;q61 =false;ns=navigator.appName==("Netscape");ns4=(ns &&(navigator.appVersion.indexOf("4.")!=-1));mac=(navigator.appVersion.indexOf("Mac")!=-1);ie=(navigator.appName.toLowerCase().indexOf("microsoft")>-1);ie5=(navigator.appVersion.toLowerCase().indexOf("msie 5.")!=-1);ie6=(navigator.appVersion.toLowerCase().indexOf("msie 6.")!=-1);ie4=((ie)&&(!ie5)&&(!ie6));ns5=(navigator.vendor==("Netscape6")|| navigator.product==("Gecko"));if((ns5)||(ie6)||(ie4))ie5=true;ie5only=((ie5)&&(!ns5)&&(!mac));(ie5only)? brn="ie":brn="ns";if((ns5)||((ie5)&&(mac)))brn="ns6";document.write("<script language=\"JavaScript1.2\" src=\""+DQM_codebase+"dqm_"+brn+".js\"></script>");document.close();;function DQM_handleOnload(){if(q61)return;q31();if(!ie5only){i=0;while(eval("window.DQM_rollover_image"+i)){q20=q20.concat(new Array(new Image()));q20[i].src=eval("DQM_rollover_image"+i);q21=q21.concat(new Array(q16("menu"+i).src));i++;}}q61=true;eval(DQM_onload_statement);};function q27(nid){if(eval("window.DQM_rollover_image"+nid)){if(ie5only)eval("q16(qmim"+nid+")."+q59);else q16("menu"+nid).src=q21[nid];}};function q30(menu){if((menu.lasthl!=null)&&(menu.q60==null))q4(menu);};function q31(){for(i=0;i<q18;i++){if(eval("window.DQM_subdesc"+i+"_0"))q1(i,true);}for(i=0;i<q19.length;i++)q1(q19[i],false);};function q32(index){if(!eval("window.DQM_url"+index))return;if(eval("window.DQM_urltarget"+index))where=eval("DQM_urltarget"+index);else where=DQM_urltarget;if((where.length<1)||(where.toLowerCase()=="_self")){window.location.href=eval("DQM_url"+index);}else {if(where.toLowerCase().indexOf("_parent")>-1)eval("parent.window.location=DQM_url"+index);else if(where.toLowerCase().indexOf("_new")<0)eval("parent."+where+".location=DQM_url"+index);else window.open(eval("DQM_url"+index));}};function q33(coords){var q72=new Array(0,0);var txy=coords.indexOf(",");if(txy!=-1){q72[0]=parseInt(coords.substring(0,txy));q72[1]=parseInt(coords.substring(txy+1));}return q72;};function getLevelVal(id,endv,rt){level=0;k=0;while((k=id.indexOf("_",k+1))>-1)level++;if(eval("window.DQM_border"+endv+level))return eval("DQM_border"+endv+level);else return rt;}


    Thanks for any attempt!

    Steve

  2. #2
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow. That is some of the ugliest and most unorganized code I have seen since I used dreamweaver. (If kind of reminds me of dreamweaver). Anyways through the bottom of the code there is mention of

    "dqm_url"+index

    thats what you want to change. That is what top.location.href is trying to load. Index your pages in a simlar way and label them the same name

    bob1
    bob2
    bob3

    and the put in

    "http://www.ramprage.com/bob"+index

    that should work. Now I am going to go and take some migrane medication.
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  3. #3
    Web Genius
    Join Date
    Nov 2001
    Location
    Canada
    Posts
    708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I agree the code is absolutely horrible and a complete mess!

    I think I'd be better off just doing it all over by myself and Fireworks Because whoever did this is a sloppy joe! I can't do anything with this even if I wanted to.

    Thanks for your suggestion


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •