Well, if #flat is a link, you should either return false or prevent the default of the event:
Code:
<script type="text/javascript">
$('#flat').click(function(){
$('#step2').load('step3layout.php');
return false;
});
</script>
or:
Code:
<script type="text/javascript">
$('#flat').click(function(e){
$('#step2').load('step3layout.php');
e.preventDefault();
});
</script>
And once you do that you can have the href of #flat be the URL you want:
Code:
<script type="text/javascript">
$('#flat').click(function(e){
$('#step2').load(this.href);
e.preventDefault();
});
</script>
And once you're doing that, you can do a whole class of links at once:
Code:
<script type="text/javascript">
$('.flat').click(function(e){
$('#step2').load(this.href);
e.preventDefault();
});
</script>
And the code will take the href from each link that has a class of "flat".
The browser cache may need to be cleared and/or the page refreshed to see changes.
If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
Bookmarks