jquery infinite scroll
$(window).scroll(function () {
// End of the document reached?
if ($(document).height() - $(this).height() == $(this).scrollTop()) {
$.ajax({
type: "POST",
url: "index.aspx/GetData",
contentType: "application/json; charset=utf-8",
data: '',
dataType: "json",
success: function (msg) {
if (msg.d) {
$(".container").append(msg.d);
}
},
error: function (req, status, error) {
alert("Error try again");
}
});
}
});
Also in JavaScript:
- node express mongo boilerplate with jwt
- Function to convert an Array to an Associative array
- javascript string replace
- devtools failed to load sourcemap when debugging react native
- javascript get cpu cores
- conditional rendering alert if input fields are empty
- app.js:19465 Uncaught TypeError: Cannot call a class as a function
- array.filter in js
- angular material upload file
- switch case in js
- using multiparty with node js express
- how to swap two elements in an array js
- react native AsyncStorage
- smtpjs cdn
- js redirect code
- how to use fetch() to fetch an image from database in js
- paper material ui improt
- jest simulate toggle switch react native
- linkedin api nodejs tutorial
- angular one way property binding
- jquery alertify
- js for each item do
- javascript write to text file
- ckeditor get content html