Answered and resolved. Thankyou Jake
Hi
I hope someone her can help me.
I want to insert the contents of my sidebar into multiple pages using jquery instead of php.
The reason for this is that when I changed over to php with the template I'm using it
became unusable. The link only went to download option instead of opening.
Therefore I have been exploring the possibility of using jquery to get the same
results. I have been searching the internet and prowling through forums for two
weeks now and found a few snippets of code that might work but I don't know
how to put them all together to get the results I'm looking for.
I have studied several jquery and java script tutorials and found some references
to importing content but nothing specific enough for me get it to work.
For example, part of the jscript is shown with no reference to what else is needed
in the file. The more I read the more confused I'm getting. Maybe I'm doomed to just
putting any additions to the menu into hundreds of pages manually. (it's a shopping site)
I have tried the following, among others, inserted into web page
with and without external js file, all to no avail:
1.
<script src="jquery.js"></script>
<script>
$(document).ready(function() {
$("body").load("structure.html", function() {
$("leftmenu").load("leftmenu.html");
});
});
</script>
2.
<script src="jquery.js"></script>
<script>
$(document).ready(function()
$.get( "leftmenu.html", function( data ) {
$("leftmenu").load("leftmenu.html");
});
});
</script>
3.
<!DOCTYPE html>
<html>
<head>
<script>
$(document).ready(function(){
$("#div1").load("left-menu.html");
});
});
</script>
</head>
<body>
The html/php page I want to get content from is a list of links for the sidebar.
I don't know what I'm doing wrong so any help would be appreciated.