This short-note will make sense, only if you already have some javascript sense. It can be used – just to refresh memory, once in a while. My JavaScript Experience? started on 2000, conducted a JavaScript Training Session on 2001, wrote a book for a training institute on JavaScript on 2001, using javascript always from that time – for this and that (personal and/or commercial, at home/work). Am I an expert? That’s an interesting question – “I am an expert” is a ridiculous statement to me (also in my culture to some extent), However, I can say – whatever I wanted to do or I was required to do in JavaScript – I could do – without much/any trouble, and without hanging in the forums for weeks waiting for someone else to reply to my silly questions. I also believe, whatever I will require to do in JavaScript, I will be able to do without any/much trouble.
- How to embed applet in javascript code:
Parameter values are passed to the applet
- Possible attributes of applet tag: code, archive, name, height, width, mayscript
- Custom applet parameters are sent by using param tag
- You can use JSObject to pass information from Applet to javascript
Java Side:JSObject jso = JSObject.getWindow(this);jso.eval("slider(" + jCSlider1.getValue() + ")");JavaScript Side:function slider(theSetting) {document.theForm.txtSetting.value = theSetting;}
- Linking to shockwave files:
http://value1.dcr
- Linking to activex objects/controls:
ActiveXcontrol.property="value";
ActiveXcontrol.property=”value”; is to access activex objects’ properties
- Communicating with Java Server Pages:
- Difference Between CSS visibility and display Attributes: When visibility is false, the area is replaced with white spaces. When display attribute is false, the block is completely removed [no white space occulies the area]
- Within javascript, you can also use CSS properties. The syntax: document.elementname.style.propertyname
Example:document.element1.style.visibility = 'hidden';
- Javascrip and CSS property mapping:
CSS Property JavaScript Reference background background background-color backgroundColor background-image backgroundImage border border border-color borderColor border-style borderStyle color color display display font font font-family fontFamily font-size fontSize margin margin margin-bottom marginBottom margin-left marginLeft margin-right marginRight margin-top marginTop vertical-align verticalAlign visibility visibility - Change element appearance dynamically:
document.getElementById(“element id”).style.visibility = “property”; - Change the background color of an element:
document.getElementById(“element id”).style.background = color; - Element content manipulation:
sometext
document.getElementById("para1").innerText = "newtext";document.getElementById("para1").innerText = "newtext";document.getElementById("para1").innerHTML = "newtext"; - Validating Forms in JavaScript using Custom objects: I think, an example will make sense
<SCRIPT language="JavaScript"> var frmvalidator = new Validator("myform"); frmvalidator.addValidation("FirstName","alpha"); frmvalidator.addValidation("FirstName","alpha"); frmvalidator.addValidation("FirstName","req","Please enter your First Name"); frmvalidator.addValidation("FirstName","maxlen=20","Max length for FirstName is 20");
- Create temporary cookie:
document.cookie = "myCookie=gingerbread";cookieValue = escape("A B, C D");document.cookie = "myCookie=" + cookieValue;expDate = "Wed, 3 Mar 2000 14:41:00 UTC";document.cookie = "myCookie=sugardrop;" + "expires=" + expDate;
- To access all cookies in a loop: Get the cookie using var cookieString = document.cookie;, then split the cookiestring using split function at “;” like var cookieArray = cookiestring.split(“;”); Then you can use a loop to traverse the array and retrieve cookie name and value
- Deleting cookies:
function del_cookie(name) { document.cookie = name + '=; expires=Thu, 01-Jan-70 00:00:01 GMT;';}
- Javascript Array Examples:
thisArray = new Array();thisArray.Contents = "Alphabet";thisArray[0] = "A";thisArray[1] = "B";thisArray[2] = "C";-----garden["North Patch"] = "vegetables";garden["South Patch"] = "herbs";garden["West Border"] = "perennial flowers";-------processors = new Array("AMD","Intel","Cyrix","Motorola");
- Delete an array element:
delete anArray[2]; it does not change the length of the array but anArray[2] will have no value and undefined - Destroy an array:anArray.length = 0;anArray = null;
- Other Javascript articles What you really need to learn in Javascript?
How to implement multiple tab webpages in Ajax and Javascript
Handling Checkbox arrays with Javascript::GetElementsByName:XHTML supported
JavaScript – Miscellaneous Validations
JavaScript: Pass by Value: Pass by Reference
Random Notes on JavaScript/HTML
Random Notes on JavaScript/HTML
JQuery
From: http://sitestree.com/?p=5208
Categories:13
Tags:
Post Data:2009-03-19 21:26:36
Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
(Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a>
In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
<a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>