I've not much experience with ajax and would like to know if it is possible to load external content into a bunch of empty divs using jQuery's load() method + json.
I have the following as a starting point:
<div id="aboutUs"></div>
<div id="whatWeDo"></div>
<div id="ourValues"></div>
<div id="ourExpertise"></div>
var loadPages = { 'pageData' : [
{
'loadInTo' : '#aboutUs',
'url' : 'http://www.website.co.uk/aboutUs.html',
'urlSection' : '#aboutUs'
},
{
'loadInTo' : '#whatWeDo',
'url' : 'http://www.website.co.uk/whatWeDo.html',
'urlSection' : '#whatWeDo'
},
{
'loadInTo' : '#ourValues',
'url' : 'http://www.website.co.uk/ourValues.html',
'urlSection' : '#ourValues'
},
{
'loadInTo' : '#ourExpertise',
'url' : 'http://www.website.co.uk/ourExpertise.html',
'urlSection' : '#ourExpertise'
}
] }
The 'loadInto' specifys where I want the html to be inserted on the page, 'url' is the page I'm loading from and 'urlSection' is portion of the url I want to load in.
Can anyone help point me in the right direction? Many thanks in advance.