i have some simple jquery tabs:
<script>
$(function() {
$( "#tabs" ).tabs();
});
</script>
<div class="demo">
<div id="tabs">
<ul>
<li><a href="#tabs-1">Nunc tincidunt</a></li>
<li><a href="#tabs-2">Proin dolor</a></li>
<li><a href="#tabs-3">Aenean lacinia</a></li>
</ul>
<div id="tabs-1">
<ul>
<li>
<div><?php id='123'; ?></div>
<a id="test" class="link-image1" href="#tabs-2?id=123">test</a>
</li>
<li>
<div><?php id='234'; ?></div>
<a id="test" class="link-image2" href="#tabs-2id=234">test</a>
</li>
</ul>
</div>
<div id="tabs-2">
<?php if(isset($_GET['id'])){ echo $_GET['id']; } ?>
<div id="placeholder"></div>
</div>
<div id="tabs-3">
<p>Mauris eleifend est et turpis. Duis id erat.</p>
</div>
</div>
</div>
what i want is to pass a variable, id, to some other tab.
I’m not concern with making the tabs work, in case they don’t, but only on passing that variable
is this possible?
edit:
i have this javascript:
$(".link-image").click(ajax_request);
$('#placeholder').load("/test.php?id=1234556");
the idea is that when i click on .link-image link i will change the tab and send a ajax request to load something there, but i need to pass the id variable with it
edit:
when i click on link-image1 i want to pass the id from the same li and so on
You can use
$(this).attr('href')to get thehrefattribute.