<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.conservapedia.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=KevinPas</id>
	<title>Conservapedia - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.conservapedia.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=KevinPas"/>
	<link rel="alternate" type="text/html" href="https://www.conservapedia.com/Special:Contributions/KevinPas"/>
	<updated>2026-10-21T12:51:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://www.conservapedia.com/index.php?title=JavaScript&amp;diff=1068252</id>
		<title>JavaScript</title>
		<link rel="alternate" type="text/html" href="https://www.conservapedia.com/index.php?title=JavaScript&amp;diff=1068252"/>
		<updated>2013-10-15T14:17:57Z</updated>

		<summary type="html">&lt;p&gt;KevinPas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''JavaScript''' is a [[programming language]] used for [[website|web]] development. While it is primarily used as a scripting language, it has some [[object-oriented]] features.&amp;lt;ref&amp;gt;[http://mckoss.com/jscript/object.htm Object Oriented Programming in JavaScript] - Mike Koss&amp;lt;/ref&amp;gt; It is used mainly&amp;lt;ref&amp;gt;For server side and desktop usage see http://vertx.io/ and http://nodejs.org/&amp;lt;/ref&amp;gt; for [[client-side]] programming; for a good [[server-side]] language, see [[PHP]].&lt;br /&gt;
In a [[web browser]], JavaScript has access to the content of [[HTML]] documents.&amp;lt;ref&amp;gt;David Flanagan, ''Javascript: The definitive guide'', page 6&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arrays==&lt;br /&gt;
&lt;br /&gt;
JavaScript doesn't have the same kind of arrays as [[Java]]; this is one of the differences between the two languages.&lt;br /&gt;
In JavaScript, the standard array notation is used, but internally data is stored in a [[hash table]].&lt;br /&gt;
&lt;br /&gt;
==Visibility of class members==&lt;br /&gt;
There are two sets of variables associated with any object you define in JavaScript.&lt;br /&gt;
The first set of variables defined with the &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt; keyword, are all public. The second set of variables, defined with the &amp;lt;code&amp;gt;var&amp;lt;/code&amp;gt; keyword, are private. You can even use the same name for a public and private variable, and JavaScript can tell them apart.&lt;br /&gt;
&lt;br /&gt;
===Accessing public and private variables===&lt;br /&gt;
Use regular dot notation to get the public variables of an object&lt;br /&gt;
* shape.size&lt;br /&gt;
Within class functions, use this to get a public variable, and '''omit''' to get a private variable!&lt;br /&gt;
&lt;br /&gt;
== Example Code ==&lt;br /&gt;
The following example can be used to disable a form button, for example, to prevent double-posting on a forum.&lt;br /&gt;
&amp;lt;pre&amp;gt;// Following code licensed CC-SA&lt;br /&gt;
&lt;br /&gt;
function ref(object)&lt;br /&gt;
{&lt;br /&gt;
    if (document.getElementById) { return document.getElementById(object); }&lt;br /&gt;
    else if (document.all) { return eval('document.all.' + object); }&lt;br /&gt;
    else { return false; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function setButton(btnObject)&lt;br /&gt;
{&lt;br /&gt;
    if ( document.post.btnName &amp;amp;&amp;amp; document.post.btnValue )&lt;br /&gt;
    {&lt;br /&gt;
        document.post.btnName.value = btnObject.name;&lt;br /&gt;
        document.post.btnValue.value = btnObject.value;&lt;br /&gt;
    }&lt;br /&gt;
    else if ( document.all.btnName &amp;amp;&amp;amp; document.all.btnValue )&lt;br /&gt;
    {&lt;br /&gt;
        document.all.btnName.value = btnObject.name;&lt;br /&gt;
        document.all.btnValue.value = btnObject.value;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    var postForm = ref('post');&lt;br /&gt;
    postForm.submit();&lt;br /&gt;
    return true;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
To make use of this function, add it to the JavaScript used by your form, and then add the following to the button you wish to disable:&lt;br /&gt;
&amp;lt;pre&amp;gt;onClick=&amp;quot;setButton(this);&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==External Links==&lt;br /&gt;
[http://www.webteacher.com/javascript/ Javascript Tutorial]&lt;br /&gt;
[[Category:Scripting Languages]]&lt;/div&gt;</summary>
		<author><name>KevinPas</name></author>
	</entry>
</feed>