记录 js拼接url 比如有些时候我们需要为某按钮实现跳转,可以利用下面的方式做到: function ReturnIndex() { var rex = RegExp("tools") var url = window.location.origin var new_url = "http://127.0.0.1:"+window.location.port if (url.match(rex)) { curr_url = window.location.orig
代码如下: function Animal(){} function Dog (age){ this.name = 'fuck you' ; this.age = age } var dog = new Dog(12); console.log(dog); //{name: "fuck you", age: 12} Dog.prototype = Animal; var dog2 = new Dog(12); console.log(dog2);//{age: 12} dog2对象的n
XSS攻击在最近很是流行,往往在某段代码里一不小心就会被人放上XSS攻击的代码,看到国外有人写上了函数,咱也偷偷懒,悄悄的贴上来... 原文如下: The goal of this function is to be a generic function that can be used to parse almost any input and render it XSS safe. For more information on actual XSS attacks, check out h