যখন স্ক্রিন নিচে টেনে পেজ রিফ্রেশ করে লেটেস্ট আপডেট পাওয়ার প্রয়োজন হয়, তবে এটি জাভাস্ক্রিপ্ট, xhttprequests এবং টাচ ইভেন্ট দিয়ে করা যায়।
পুল রিফ্রেশ AJAX-এ XHR-কে ট্রিগার করে। এটি নতুন ডেটা এলিমেন্টে যোগ করে যা আমরা চাই।
পুল রিফ্রেশ ইমপ্লিমেন্ট করা যায় হাইজ্যাকড জাভাস্ক্রিপ্ট স্ক্রোলিং মেকানিজম যেমন iscroll দিয়ে। টুইটার iscroll ব্যবহার করে পুল রিফ্রেশ অপশন দেয়।
আরেকটি উপায় হলো overflow:scroll কম্পোনেন্টের জন্য একটি রিফ্রেশ হ্যান্ডলার তৈরি করা।
ইন্টারফেসটি হ্যান্ডলার ইন্টারফেস সম্পর্কে ধারণা দিতে পারে:
var PullToRefresh= function(callback, wrapper, instructionsText) { //It creates dom elements and append them before content wrapper // <div class="mainWrapper" style="overflow: scroll; height: 600px;"> <div class="pullToReloadWrapper"></div><div class = "contentWrapper"></div> </div> is the markup. // if main wrapper's height is > than content wrapper's height, then change the main wrapper height to be the height of the content wrapper. // scroll main wrapper. // invoke initializeEvents() to inititalize the events };