Subversion Repositories SmartDukaan

Rev

Rev 13583 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

$(function(){
        $('.scroll').jscroll({
                loadingHtml: '<center><img src="/img/ajax-loader.gif" alt="Loading" /></center>',
            autoTriggerUntil: 3,
            padding: 20,
        });
        $('.scroll').on('click','.viewproduct',function(e){
                console.log(e.target);
                var url = apihost+"clicks/add/"+me+"/"+$(this).data('id');
                $.ajax({
                        url: url,
                        // The name of the callback parameter, as specified by the YQL service
                        jsonp: "callback",
                        // Tell jQuery we're expecting JSONP
                        dataType: "jsonp",
                        // Tell YQL what we want and that we want JSON
                        data: {
                                format: "json"
                        },
                        // Work with the response
                        success: function( response ) {
                                if(response.success && response.type=='redirect'){
                                        document.location = response.url;
                                }
                        }
                });
        })
});