(waves newbie flag, also new to JS and jQuery)
I'm working on my companies website, being built on Squarespace.
We have a group of products most of which also have some sort of accessories. I am trying to avoid a super long page of divs with a tabbed interface, that many divs was making me go cross eyed.
So I thought I could use the SuperFish dropdown plugin for jQuery, and that seems okay so far. But now I am faced with getting the information stored in separate pages to be called and placed into the main page without replacing the page.
Now ... when I click the one link i have setup to test this, the link does the "expected" response of loading the html page but it takes over the whole thing and removes my navigation.
I am completely willing to do my own work and RTFM, but I am not sure where to look in said manual. So I am open to pointers to documentation.
Here's what I have so far.
// initialise plugin
$(document).ready(function() {
$(function(){
$('ul.sf-menu').superfish();
// this bit was taken from this tutorial: http://is.gd/PuaK-
$('#nav li a').click(function(){
// function to load in the actual page data
var toLoad = $(this).attr('href')+' #content';
function loadContent() {
$('#content').load(toLoad,'',showNewContent);
}
function showNewContent() {
$('#content').show();
}
return false;
});
Thanks for looking.
6/10/09 - update - I've spent some more time RTFM. And I have gotten to the point where I think I understand how the ".load" function works. I've been able to successfully use it on a test page. So now i think I can clarify my goals.
Refined Statement:
I want to take an <a>
destination and take the contents of a <div>
the data into an <iframe>
.
This is my first real development using JavaScript; and I know it's frustrating dealing with newbs sometimes, I thank you in advance for your patience.
6/15/09
Okay ... I am putting this idea aside for now. It is way out of my depth and is currently holding up the production big time. If anyone has a good idea I'm still open, thanks again.