Im loading both a menu and a page content with the .load.
First the menu should load and when click on one menu item it should load the url and that “content” in the “container”.
This works but something is wrong, because it messes up the loadFacebook function below so I need to change it.
$(document).ready(function() {
loadPage();
});
function loadPage(url) {
$('#guiden_menyn').load('manmade/guiden/guiden_menyn.html #content',
hijackLinks);
$('#container').load(url + ' #content', hijackLinks);
}
function hijackLinks() {
$('#guiden_menyn a').click(function(e) {
e.preventDefault();
loadPage(e.target.href);
});
}
And a link i the menu “guiden_menyn.html” looks like this:
<a class="lank" href="manmade/guiden/tipsa.html">
function loadFacebook() {
$('#container').load(
'http://www.manmade.se/manmade/guiden/facebook_onweb.html',
function() {
FB.XFBML.parse();
});
}
Maybe I need to set a onclick to run the function on the link instead of the “$(‘#guiden_menyn a’)….”?
How should it be, any suggestions appreciated, thanks!
Use a function like this
Here is html
Give lank class to every hyperlink
Then