Results 1 to 4 of 4

Thread: ajaxtabs.js script for ajaxtabs broken when port other than default in IE

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

    Default ajaxtabs.js script for ajaxtabs broken when port other than default in IE

    The ajaxtabs.js script loses the port part of the url when used in IE.
    Works great in firefox.
    I run locally on web port 8101 and that was being lost in IE 6.
    Here is the old line and new line to fix:


    var modifiedurl=ulistlink.getAttribute("href").replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/")

    var modifiedurl=ulistlink.getAttribute("href").replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+ ":" + window.location.port + "/")

  2. #2
    Join Date
    Aug 2004
    Posts
    9,896
    Thanks
    3
    Thanked 967 Times in 955 Posts
    Blog Entries
    15

    Default

    Thanks, I'll look at possibly updating the script with the fix. Online I guess it's not too common for a live URL to contain a port though, no?

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

    Default Thanks for the reply

    No online, almost never hit a port.
    But in development , multiple servers/ports running various versions of
    code is common here.

  4. #4
    Join Date
    Jul 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb

    Quote Originally Posted by rcwood
    The ajaxtabs.js script loses the port part of the url when used in IE.
    Works great in firefox.
    I run locally on web port 8101 and that was being lost in IE 6.
    Here is the old line and new line to fix:


    var modifiedurl=ulistlink.getAttribute("href").replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/")

    var modifiedurl=ulistlink.getAttribute("href").replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+ ":" + window.location.port + "/")
    Actually, you should be able to just do this:
    var modifiedurl=ulistlink.getAttribute("href").replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.host+"/")

    Using "host" instead of "hostname".

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
  •