This is the sixth day of my participation in Gwen Challenge

Look back to the QQ space of juvenile period

When I was brushing the forum, I saw a big man said that the front-end code of QQ space was full of ridicule and bug haha, so I opened my QQ space with a trumpet.

Skipping a lot of Martian text and I love you you love me dynamic, we went to see about the album page, I had not learned the code to see that I had to input the answer to the question to check the album of my secret love little sister, directly shocked.

QQ space photo album ridicule

As shown above, we clicked on the photo album to answer the question, loaded a file called qa.html, and even the front-end code of that era wasn’t compressed

As soon as I came in, I saw the joke.

var Q = QPHOTO;
var $show = Q.util.$show;
var myView = {
	init : function(){
		var d = Q.data.get("popup_data");
		// Very disgusting qalist
		d.qalist = d.qalist || [];
		$("question").innerHTML = escHTML( restHTML( d.question || d.qalist[0])); $("answer").value = d.answer || "";
Copy the code

Textbook inheritance method annotations

The constructor to create user code, textbook notes ha ha ha understand again.

function xExtend() {
	var args = arguments, a0 = args[0], a1 = args[1], a2 = args[2];
	// The first argument is a function type, so it is class inheritance, and the first argument is the base class
	// The subclass information is required as the second argument
	if (typeof a0 == 'function') { 
		a1 = a1 || {};
		if (/function|number|string|undefined/.test(typeof a1))
			return;
			
		var f, de, c, spargs;

		// Specify the default null constructor for those without constructor
		if ('function'! =typeof a1['_constructor']) { 
			f = function() {
				a0.apply(this.arguments); }}else {
			// Encapsulate the user's constructor so that it can automatically call the parent's constructor
			// This is the basis of OO, new subclasses must call the parent class constructor first
			f = function() {				
				// Save the constructor arguments
				spargs = arguments;

				// Call the parent constructor
				a0.apply(this, spargs);

				// Call the constructor
				a1['_constructor'].apply(this, spargs); }}// Implement inheritance
		var ff = function() {};
		ff.prototype = a0.prototype;
		f.prototype = new ff;
		f.prototype.constructor = f;

		// Parent pointer
		f.prototype.base = a0;

		// Add the prototype method
		var grep = /^name|_constructor|static|base$/;
		for (var i in a1) {
			if (grep.test(i)) 
				continue;
			f.prototype[i] = a1[i];
		}

		// Superclass methods that cannot be overridden by subclasses but can be called
		for (var i in a0.prototype) {
			if (i.indexOf('$') = =0) {
				f.prototype[i.slice(1)] = a0.prototype[i]; }}// Add a static member
		if (a1['static']) {
			for (var i in a1['static']) 
				f[i] = a1['static'][i];
		}
		// Optional to register the class name with the external environment.
		/ / # 1. The user needs the global name and the global space does not exist
		/ / # 2. If the specified external is an object, the class is attached to that object
		if ('undefined'! =typeof a1['name'] && /^[a-zA-Z]\w*$/.test(a1['name']) {var s = 'object'= =typeof a1['scope'] && a1['scope'] | |window;
			s[a1['name']] = f;
		}
		return f;
	}
	// Follow the normal extend logic
}
	window.xExtend = xExtend;

Copy the code

QZ Dialog bug fixed?

 onLoad: function (dia) {
    //QZ Dialog has a bug, temporary fix
    dia.onUnload = dia.opts.onUnload;
    $(dia.dialogContent).delegate('.j_changeimg'.'click'.function(){
        $(dia.dialogContent).find('.j_imgVerify').attr("src",getCaptchaUrl());
    });
},
Copy the code

Sand carving net friend found ridicule code

Top trending comments at the end