Link to home
Start Free TrialLog in
Avatar of chuckalicious
chuckaliciousFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Open New URL from JQuery Tab

Ok, I'm new to Javascript and even newer to JQuery, but am trying to learn both!

I have a webpage where I have implemented JQuery ui Tabs and they are working absolutely fine, using the default function shown below.

However, I have a real need to be able to open a new URL, using one of the tabs, however, I can't see how to do this. I'm sure it's possible, I just don't know how.

I understand I can use AJAX in a tab, but this solution won't work for me, I really need to be able to set the href of a tab to a normal URL and have it open as if the user had clicked on a bog standard link, ie in the existing window, not in a new window.

If anyone can help I'd be extermely grateful!
$(document).ready(function() {
	$(function() {
		$("#tabs").tabs();
	});
 });

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of anoyes
anoyes
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chuckalicious

ASKER

Ok, close enough. Your code still opens the link in a new window, which isn't what I'm looking for, however, I changed the code to the following. It now works nicely, so thanks :)


window.location=($(ui.tab).attr("href").replace('#',''));

Open in new window