So I am using Jquery's load function like so,
$('#id').load("http://www.thisiswhyimbroke.com");
I know you can add id selectors after the url, but the content im looking for is not contained within an id, is there a way I can select a particular class name?
Even further, if I could select the first li item, then select the class with name item within it, is that possible?
You can provide any selector, for example
$('#id').load("http://www.thisiswhyimbroke.com li:first .someclass");
From the documentation :
Loading Page Fragments
The .load() method, unlike $.get(), allows us to specify a portion of the remote document to be inserted. This is achieved with a special syntax for the url parameter. If one or more space characters are included in the string, the portion of the string following the first space is assumed to be a jQuery selector that determines the content to be loaded.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With