Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

using Ajax & Jquery to call first class

jQuery ajax jquery

  • Please log in to reply
No replies to this topic

#1 JamesHusband

JamesHusband

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts
  • Learning:JavaScript

Posted 09 September 2012 - 12:52 AM

Hi everyone,

im currently designing a website for a hotel. I have a 'special offers' page and im trying to call the latest offer and show it on the home page. Iv got it working with the script below but my problem is its pulling every offer and i cant work out how to only pull the first element.

Home page
- http://garracktemp.c....com/index.html

Offers page
- http://garracktemp.c...ial-offers.html


$(document).ready(function(){
$('#test').load('/Garrack_Hotel/special-offers.html .offer_info_content', '', function(response, status, xhr) {
if (status == 'error') {
var msg = "Sorry but there was an error: ";
$(".content").html(msg + xhr.status + " " + xhr.statusText);
}
});
});



any help with this would be great as im still getting to grips with js and azax
  • 0





Also tagged with one or more of these keywords: jQuery, ajax, jquery

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download