This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def add_category(request): | |
result = {'success':False} | |
n_category = request.GET.get('n_category', None) | |
if n_category is not None: | |
new_cat = Category(name=n_category) | |
new_cat.save() | |
result = {'success':True, 'value':new_cat.id} | |
json = simplejson.dumps(result) | |
return HttpResponse(json, mimetype='application/json') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: var i = 0; while (i<=69) { localStorage.setItem('level_star_'+i,'-1'); i++; } window.location.reload(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('a.more').live('click', function(event) { | |
$.fancybox.showActivity(); | |
$.ajax({ | |
type : "POST", | |
cache : false, | |
url : "load.html", | |
data : $(this).serializeArray(), | |
success : function(data) { | |
// Aplico el selector solo al contenido de data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('a.more').live('click', function(event) { | |
$.fancybox.showActivity(); | |
$.ajax({ | |
type : "POST", | |
cache : false, | |
url : "load.html", | |
data : $(this).serializeArray(), | |
success : function(data) { | |
// Aplico el selector solo al contenido de data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("select").change(function () { | |
if ($(this).val() == 'somevalue'){ | |
// do something | |
// puedes usar $(this).text() para obtener lo que se muestra en el select, .val() devuelve es el id | |
}else{ | |
// do something else | |
} |
NewerOlder