Skip to content

Instantly share code, notes, and snippets.

@cole007
Created December 17, 2014 10:50
Show Gist options
  • Save cole007/0bf70bfaf73c93b56ad7 to your computer and use it in GitHub Desktop.
Save cole007/0bf70bfaf73c93b56ad7 to your computer and use it in GitHub Desktop.
<!-- from page being fetched -->
<div class="page-content">
<h1>here is some content on the case-study page</h1>
</div>
<!-- response from static HTML prototype -->
<!-- success - console log returns relevant object -->
[div.page-content, prevObject: x.fn.x.init[35], context: undefined, selector: ".page-content", jquery: "1.10.2", constructor: function…]
<!-- response from CMS implementation -->
<!-- failure - console log returns object but undefined if try to access -->
[prevObject: x.fn.x.init[62], context: undefined, selector: ".page-content", jquery: "1.10.2", constructor: function…]
// url = path to page being fetched
function doAdjacent(url,dir) {
$.get( url, function( data ) {
console.log($(data).find('.page-content'));
});
}
@sherred
Copy link

sherred commented Dec 17, 2014

try checking that data is the same in both contexts, if you change console.log($(data).find('.page-content')); to console.log(data) what results do you get?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment