0

I have the following script which is taking content with with a certain class, loads it into a particular div and then removes the content with a different class. Works great.

$(document).ready(function() {
  $('#reports').load('../lists/2025-reports.html .report-item:lt(3)', function() {
    $('#reports').find('.description').remove();
  });
});

BUT then I try to us the same function again, loading content from a different page, and put it in a differently labeled div and the script doesn't work outside of Dreamweaver.

$(document).ready(function(){
  $('#featured-blogs').load('../lists/2025-blogs.html .blog-item:lt(3)', function() {
    $('#featured-blogs').find('.description').remove();
  });   
});

I'm not seeing any errors in the console and there doesn't seem to be any permissions issues so I'm at a loss as to why this isn't working.

3
  • typo error, you have a quote character in '$(document). Commented 2 days ago
  • 3
    I don’t think there’s any way we could know just by looking at essentially-identical code, which means it’s either the page dom or the loaded page dom (or lack of a file etc) Commented 2 days ago
  • The typo is in me copy and pasting into this form, I just double checked that actual code in question and the quote character isn't there.
    – DWLynch
    Commented 2 days ago

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.