SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Once I was a Factory Worker goofy's Avatar
    Join Date
    Dec 2004
    Location
    Sydney Australia
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Change dynamic link in Javascript code

    I've got to change a link on a site I'm working on. All I want to do is open the link in a new window. Most of this site works with all this javascript and I've narrowed down to this bit of code but I'm not really sure where to go from here. I've done a bit of Actionscript in flash so that's how I've been able to get to here.

    It's pretty confusing trying to follow all the codes as there is quite a bit from arrays that are being included etc so I won't try to explain everything that's going on.

    One bit of code that I would like someone to explain is below.

    Code:
    href='javascript://'
    Here is the code that I've narrowed it down to. It's from a navigation drop down list that is dynamic.
    Code:
    function layoutList(listName,listTitle,showThumb){
          var htmlStr = '';
          if(listGroup[listName] && listGroup[listName][0] != null){
            if(++layoutCount > 1){htmlStr += "<br>"}
            htmlStr += "<nobr><font class='heading'><a title='Open "+listTitle+" properties list' href='javascript://' onClick=\"listClick('"+listName+"')\"><img id="+listName+"Widget galleryImg=no border=0 src='../image/";
            if(openedList == listName){ htmlStr += 'listopen' }
            else{ htmlStr += 'listclosed' }
            htmlStr += ".gif'>"+listTitle+" properties</a></font><br></nobr>";
            if(isDynamic || openedList == listName){
              htmlStr += "<table id="+listName+"List border=0 cellpadding=0 cellspacing=";
              if(showThumb){htmlStr += '8'}else{htmlStr += '6'}
              if(openedList != listName){ htmlStr += " style='display:none'" }
              htmlStr += ">";
              if(!showThumb){htmlStr += "<tr><td><img galleryImg=no border=0 src='../image/spacer.gif' width=10 height=1></td><td align=left>"}
              for(i=0;i<listGroup[listName].length;i++){
                var itemArgs = listGroup[listName][i].split("=");
                var propID = itemArgs[0]; var propName = itemArgs[1];
                if(showThumb){
                  htmlStr += "<tr><td align=left><a target='mpgmain' href='prop_item.htm?"+propID+"'><img width=115 height=35 galleryImg=no onMouseOver='imgOver(this)' onMouseOut='imgOut(this)' src='../property/image/"+propID+"_thumb.jpg' border=1><br><nobr><img border=0 src='../image/spacer.gif' width=10 height=1>"+propName+"</a><br></nobr></td></tr>";
                }else{
                  htmlStr += "<nobr><a target='mpgmain' href='prop_item.htm?"+propID+"'>"+propName+"</a><br></nobr>";
                }
              }
              htmlStr += "</td></tr></table>";
            }
          }
          return htmlStr;
        }
    Goofy
    Life is what you make it!
    Follow your dreams!

  2. #2
    Once I was a Factory Worker goofy's Avatar
    Join Date
    Dec 2004
    Location
    Sydney Australia
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    C'mon all you javascript guru's, I know that you know the answers!!! HELP... ARGGGG!!!
    Goofy
    Life is what you make it!
    Follow your dreams!


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
  •