1 / 11

Programming in Jscript.NET

Programming in Jscript.NET. Masatoshi Natsume. Jscript. Script language developed by Microsoft Compatible with JavaScript Netscape Communication Sun Microsystems Extensions File operation Component Object Module (COM) Embedded in HTML. Jscript.NET. Current version of Jscript

manjarrez
Download Presentation

Programming in Jscript.NET

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Programming in Jscript.NET Masatoshi Natsume

  2. Jscript • Script language developed by Microsoft • Compatible with JavaScript • Netscape Communication • Sun Microsystems • Extensions • File operation • Component Object Module (COM) • Embedded in HTML

  3. Jscript.NET • Current version of Jscript • Compatible with Jscript • Supports .NET framework • Jscript.NET needs to be compiled • Jscript.NET has higher performance

  4. Declare Jscript <html> <head> <title>Sample</title> </head> <body> <script language=”Jscript”> [Program code] </script> </body> </html>

  5. Hello World!! <script language=”Jscript”> dd = new Date(); document.write(dd.toLocaleString()); document.write("<br>"); document.write("Hello World!!"); </script> View in browser

  6. Loading Script File • <script language="Jscript" src="function.js">

  7. Text Field <html> <head> <title>Text Filed</title> <script Language="Jscript"> function check() { txt = document.myFORM.myTEXT.value; if (txt == ""){ alert("Text field is empty"); }else{ alert("Entered: " + txt) } } </script> </head> <body> <form name="myFORM"> <input type="text" name="myTEXT"> <input type="button" onClick="check()" value="Check"> </form> </body> </html> View in Browser

  8. Radio Button <html> <head> <title>Radio Button</title> <script language="Jscript"> var msg; function rdo_Change(obj){ msg = obj.value; } function func3(obj){ alert("My favorite fruit is " + msg); } </script> <form name=frm3> Please select your favorite fruits<br><br> <input type="radio" name="rdo1" value="Apple" onClick=rdo_Change(this)>Apple<br> <input type="radio" name="rdo1" value="Banana" onClick=rdo_Change(this)>Banana<br> <input type="radio" name="rdo1" value="Pineapple" onClick=rdo_Change(this)>Pineapple<br> <input type="radio" name="rdo1" value="Orange" onClick=rdo_Change(this)>Orange<br><br> <input type="button" value="Check" onDblClick=func3(rdo1)><br> </form> </body> </html> View in Browser

  9. Check Box <html> <head> <title>Check BOx</title> <script language="Jscript"> function func5(){ var cnt=0; var i; for (i =0; i< document.frm5.elements.length;i++){ if(document.frm5.elements[i].checked) cnt++; } alert (cnt + " CheckBoxes are selected" + "\n" + "CheckBox1 checked: " + document.frm5.elements[0].checked + "\n" + "CheckBox2 checked: " + document.frm5.elements[1].checked + "\n" + "CheckBox3 checked: " + document.frm5.elements[2].checked + "\n" + "CheckBox4 checked: " + document.frm5.elements[3].checked); } </script> <form name=frm5> <input type=checkbox name=chk1>Check1<br> <input type=checkbox name=chk2>Check2<br> <input type=checkbox name=chk3>Check3<br> <input type=checkbox name=chk4>Check4<br><br> <input type=button value="Check" onClick=func5()> </form> </body> </html> View in Browser

  10. Conclusion • Jscript.NET is an easy language like VB.NET • The compatibility with JavaScript is not perfect • Jscript.NET has attractive features.

  11. QUESTIONS?

More Related