Subversion Repositories SmartDukaan

Rev

Rev 16730 | Rev 17070 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 16730 Rev 16767
Line 12... Line 12...
12
    });
12
    });
13
}
13
}
14
$(function() {
14
$(function() {
15
    $('span.stars').stars();
15
    $('span.stars').stars();
16
	$('.getapp').on('click',function(e){
16
	$('.getapp').on('click',function(e){
17
		console.log(e);
17
		$('#loadingModal').modal('show');
18
		var that = $(this);
18
		var that = $(this);
19
		var req = $.ajax({
19
		var req = $.ajax({
20
			url: apihost+'appAffiliates/generateRedirectUrl/'+$(that).data('me')+'/'+$(that).data('id'),
20
			url: apihost+'appAffiliates/generateRedirectUrl/'+$(that).data('me')+'/'+$(that).data('id'),
21
			// Tell jQuery we're expecting JSONP
21
			// Tell jQuery we're expecting JSONP
22
			dataType: "jsonp",
22
			dataType: "jsonp",
23
			// Tell YQL what we want and that we want JSON			
23
			// Tell YQL what we want and that we want JSON			
24
			method: 'get',
24
			method: 'get',
25
			// timeout: 30000,
25
			// timeout: 30000,
26
			// Work with the response
26
			// Work with the response
27
			success: function( response ) {
27
			success: function( response ) {
-
 
28
				$('#loadingModal').modal('hide');
28
				if(response.message=='Success'){
29
				if(response.message=='Success'){
29
					document.location = response.url;
30
					document.location = response.url;
30
				}
31
				}
31
			}
32
			}
32
		},'json');
33
		},'json');