Make attack links ajaxy

Fix hints on StoredXSS
This commit is contained in:
Rick Lawson
2014-09-25 21:05:07 -04:00
parent 2d1abcbd19
commit 019a148c9d
5 changed files with 311 additions and 336 deletions

View File

@ -92,6 +92,9 @@ goat.utils = {
return lessonName.replace(/\s|\(|\)|\!|\:|\;|\@|\#|\$|\%|\^|\&|\*/g,'');//TODO move the replace routine into util function
},
ajaxifyAttackHref: function () {
/* Jason I commented this implementation out
* I think we should show the attack link on the lessons that need it by modifying the lesson
* itself or we could add a new button up top for "show lesson link"
$.each($('a[href^="attack?"]'),
function(i,el) {
var url = $(el).attr('href');
@ -106,6 +109,14 @@ goat.utils = {
)
}
);
*/
// alternate implementation
$('#lesson_content a').bind('click', function(event) {
event.preventDefault();
$.get(this.href, {}, function(response) {
$('#lesson_content').html(response);
});
});
}
};