SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2002
    Location
    Milan, Italy
    Posts
    115
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do I put the results of a script on an HTML page?

    Hi,
    I'm in the process of redesigning my site and I found this little breadcrumbs script in this forum:

    var path = document.location.href.split("?");
    var path = path[0].split("//");
    var path = path[1].split("/");
    url = new Array();
    for (x=0; x<path.length-1; x++){
    url[x] = (x==0)? "http://" +path[0]: url[x-1]+ "/" +path[x];
    }
    path[0]="home";
    var ending = path[path.length-1].split(".");
    path[path.length-1] = ending[0];
    var breadcrumbs = "";
    for (x=0; x<path.length; x++) {
    breadcrumbs += (x<path.length-1)? "<a href='" +url[x]+ "'>" +path[x]+ "</a> >> ": path[x];
    }
    document.write(breadcrumbs+ "<br>");

    It seems to work fine, but the breadcrumbs are placed at the top of the displayed HTML page, and so cannot be seen as I have a layer/image over the top. Does anyone know how I can place the breadcrumb info ie the result of the script where I want on the page?

    I'm sure this is a simple enough thing to do, when you know how. I've already had a look though this forum, but could not find anything.

    Thanks

  2. #2
    SitePoint Addict
    Join Date
    May 2000
    Posts
    313
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try placing it within a div and then postion your div where you want it on the page.

  3. #3
    SitePoint Zealot
    Join Date
    Aug 2002
    Location
    Milan, Italy
    Posts
    115
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Done, works, brilliant.....and I've learnt something.

    Thanks for your help


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
  •