Subversion Repositories SmartDukaan

Rev

Rev 13583 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
13579 anikendra 1
$(function(){
2
	$('.scroll').jscroll({
3
		loadingHtml: '<center><img src="/img/ajax-loader.gif" alt="Loading" /></center>',
4
	    autoTriggerUntil: 3,
5
	    padding: 20,
6
	});
7
	$('.scroll').on('click','.viewproduct',function(e){
8
		console.log(e.target);
9
		var url = apihost+"clicks/add/"+me+"/"+$(this).data('id');
10
		$.ajax({
11
			url: url,
12
			// The name of the callback parameter, as specified by the YQL service
13
			jsonp: "callback",
14
			// Tell jQuery we're expecting JSONP
15
			dataType: "jsonp",
16
			// Tell YQL what we want and that we want JSON
17
			data: {
18
				format: "json"
19
			},
20
			// Work with the response
21
			success: function( response ) {
22
				if(response.success && response.type=='redirect'){
23
					document.location = response.url;
24
				}
25
			}
26
		});
27
	})
28
});