diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 653be27..283ba09 100755 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -40,8 +40,36 @@ $("pre.ruby").snippet("ruby",{style:"rand01",transparent:true,showNum:true}); // with a transparent background // without showing line numbers. + + +$("pre.javascript").snippet("javascript",{style:"rand01",transparent:true,showNum:true}); + // Finds
elements with the class "js"
+ // and snippet highlights the JAVASCRIPT code within
+ // using a random style from the selection of 39
+ // with a transparent background
+ // without showing line numbers.
+
};
+var rAmp = /&/g,
+ rLt = //g,
+ rApos = /\'/g,
+ rQuot = /\"/g,
+ hChars = /[&<>\"\']/;
+
+function hoganEscape(str) {
+ str = coerceToString(str);
+ return hChars.test(str) ?
+ str
+ .replace(rAmp, '&')
+ .replace(rLt, '<')
+ .replace(rGt, '>')
+ .replace(rApos, ''')
+ .replace(rQuot, '"') :
+ str;
+ }
+
$(document).ready(function(){
rubyCodeFormat()
});
diff --git a/app/views/layouts/tutorial/xss/_dom_xss.html.erb b/app/views/layouts/tutorial/xss/_dom_xss.html.erb
new file mode 100644
index 0000000..f0d18de
--- /dev/null
+++ b/app/views/layouts/tutorial/xss/_dom_xss.html.erb
@@ -0,0 +1,125 @@
+
\ No newline at end of file
diff --git a/app/views/tutorials/xss.html.erb b/app/views/tutorials/xss.html.erb
index f8eff5c..d03193a 100755
--- a/app/views/tutorials/xss.html.erb
+++ b/app/views/tutorials/xss.html.erb
@@ -5,6 +5,11 @@
<%= render :partial => "layouts/tutorial/xss/xss_first"%>
+
+
+ <%= render :partial => "layouts/tutorial/xss/dom_xss"%>
+
+