PDA

View Full Version : ajaxtabs.js script for ajaxtabs broken when port other than default in IE



rcwood
06-01-2006, 02:44 PM
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 + "/")

ddadmin
06-01-2006, 08:00 PM
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?

rcwood
06-01-2006, 09:33 PM
No online, almost never hit a port.
But in development , multiple servers/ports running various versions of
code is common here.

DevilDogs
07-13-2006, 09:39 PM
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".