Passed
Pull Request — master (#173)
by PoUpA
02:31
created

pokedex.content.js ➔ ... ➔ $.done   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
c 1
b 1
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
$(function () {
2
	$('.spawn-counter').each(function(){
3
		var pokemon_id = $(this).attr('id').substring('spawn_pokemon_'.length);
4
		loadSpawnCounter(pokemon_id);
5
	})
6
});
7
8
function loadSpawnCounter(pokemon_id){
9
	$.ajax({
10
		'async': true,
11
		'type': "GET",
12
		'global': false,
13
		'dataType': 'json',
14
		'url': "core/process/aru.php",
15
		'data': {
16
			'request': "",
17
			'target': 'arrange_url',
18
			'method': 'method_target',
19
			'type' : 'pokedex',
20
			'pokemon_id' : pokemon_id
21
		}
22
	}).done(function (data) {
23
		$('#spawn_pokemon_'+pokemon_id).text(data.total);
24
	});
25
}
26