Results 1 to 3 of 3

Thread: Mike's scroller - full url links only?

  1. #1
    Join Date
    Dec 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Mike's scroller - full url links only?

    1) Script Title:
    Mike's scroller

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...mikescroll.htm

    3) Describe problem:
    I'm trying to place relative (to my site) urls in my scroller links, but they don't work. Is there a way to do this?

    TIA
    Rick

    This works,
    HTML Code:
    myScroller1.addItem("<a href='http://www.mywebpage.com/events/index.html' target='_blank'>New events this week...</a>");
    But this doesn't
    HTML Code:
    myScroller1.addItem("<a href='events/index.html' target='_blank'>New events this week...</a>");

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    By not working, do you mean a JS error is produced, or simply that the link goes to a non existent page? If the later, it's normal in the sense that relative links produced by JavaScript are always relative to the page in which the link is produced, not where your .js file is. So basically this means depending on which page the script is on, you'd have to adjust the relative link's path accordingly for it to point to the correct page. Not really a pretty solution, so I'd advise most people just use absolute links if possible at all.

  3. #3
    Join Date
    Dec 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I fixed the problem - I was previewing the page and the relative links wheren't working. That is, no behavior change, no JS error (in IE) -- although, in FireFox everything worked well.

    However, after uploading the page to the site, everything worked fine (in both browsers).

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
  •