I've looked accross the web but did not find an answer to this question, where does this error could came from ?
Im working on a really simple code where I just replace some text by an other.
<div class="imgLittle" style="background-image:url(http://voyagesarabais.com/1874431.jpg4fre);"</div>
<div class="imgLittle" style="background-image:url(http://voyagesarabais.com/159431.jpg4fre);"</div>
$(document).each('.imgLittle',function(){
newLink = $(this).css('background-image').replace(/^(.*?\.jpg).*/, "$1");
$(this).css('background-image',newLink)
})
But when I run it it come out with this output :
Uncaught TypeError: callback.apply is not a function
You can have a look there : JsFiddle.
In .each
first argument should be function, like this
$('.imgLittle').each(function() {
// your code
})
Example
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