Inheritance recently because the school to do the website design, so has been on the ASP and the database on the great pains.
I was doing Java programming in the previous stage. I suddenly received the task and learned ASP, so I have been Dugezon and good at using JavaScript to frame ASP programs.
One of the obvious advantages of JavaScript is that it can define and hold its own objects. This seems to be unmatched by VBScript.
With this, JavaScript can be used to get closer to object-oriented programming. Maybe this will make website development more fun ...
But there's a serious flaw! JavaScript does not support inheritance mechanisms. Unlike Java, it supports extends keywords (although this keyword is reserved in JavaScript).
In Microsoft's ASP.net, JavaScript is only beginning to provide better support. The PHP language certainly also has the inheritance mechanism the support, these all let me favor ...
But now I can not convince the school's old men to buy a better domain space, but I do not want to endure the ASP no inheritance mechanism of the bitter, so improvisation, also have some results!
JavaScript simply does not support inheritance mechanisms! That's for sure. But we can find a way to do something and simulate one out.
Nonsense to say a bunch, first take a look at an example:
function person ()
{
Public://notice this public! In fact, there is no such use, it is only my habit. Fortunately, there is no mistake in practical application
This. Getname=person_mfgetname;
Private://As public, this is my habit.
This.m_strname= "Guest";
}