0% found this document useful (0 votes)
12 views

css Winter 23

The document provides instructions and guidelines for examiners assessing answers for the Client Side Scripting subject in the Winter 2023 examination. It emphasizes the importance of understanding over exact wording, allows for variations in answers, and includes specific examples of JavaScript concepts and methods. Additionally, it outlines the assessment criteria for programming language papers and the introduction of bilingual teaching in the first year of AICTE diploma programs.

Uploaded by

chikyabhai319
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
12 views

css Winter 23

The document provides instructions and guidelines for examiners assessing answers for the Client Side Scripting subject in the Winter 2023 examination. It emphasizes the importance of understanding over exact wording, allows for variations in answers, and includes specific examples of JavaScript concepts and methods. Additionally, it outlines the assessment criteria for programming language papers and the introduction of bilingual teaching in the first year of AICTE diploma programs.

Uploaded by

chikyabhai319
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 24
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (eutonomous) asonec- 27001-2013 Ceruiied) WINTER - 2023 EXAMINATION ‘Mode! Answer - Only for the Use of RAC Assessors Subject Name: Client Side Scripting subject code: | 99519 Important instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given inthe model answer scheme 2) The model answer and the answer writen by candidate may vary but the examiner may try to assess the Understanding evel ofthe candidate. 3) The language errars such as grammatical, spelling errors should not be given more Importance (Not applicable for subject English and Communication Skil 4) Wiile assessing figures, examiner may gle credit for principal components indicated in the figure. The figures craw by candidate and model answer may vary. The examiner may give credit for any equivalent figure érawn, 5) Celts may be given step wise for numerical problems, In some cates, the assumed constant values may vary and there may be some difference in the candidate's answers and model answer. 6) Im case of some questions credt may be given by judgement on part of examiner of relevant answer based on candidate's understanding 7), For programming language papers, credit maybe given to any other program based on equivalent concept. 8) As per the policy decision of Maharashtra State Government, teaching in English/Marathi and Bilingual (English + Marathi} medium is introduced at First year of AICTE diploma Pragramme from academic year 2021-2022. Hence if the students in fist year (frst and second semesters) write answers in Marathi or bilingual language (English ‘Marathi, the Eraminer shal consider the same and assess the answer tased on matching of concepts with model 9)_For programming language papers, n answer session comments and outout isnot required, @. [Sub ‘Answer Marking No. | Q. Scheme N T "tempt any EIVE oT he folowing TOM a) State meaning of each token of the following statement and describe M it i) Ha; ii) document, bgcolor, Ans | (il) + is the increment operator and a is the operand, hence a+* will increme Anyone | value of a by 1. explained - 1 Meach, (il) The bgCotor property specifies the background color of HTML document. 'b) _ Write and explain syntax of prompi() method in JavaScript. Mw ‘Ans ‘* prompt() method is used to display a dialogue box to the user to prompt tH Definition- 7 an input. M © Thas two buttons “OK” and “CANCEL”, if the user click on the “OK” button | Syntax: 1M then it will retum the inputed value , if the user clicks on the "CANCEL" button] then it will return a null value + Syntax: prompt(text) Page No: 1 | 24 22519 Model Answe... | & | + H a MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION tasononaus) (s0n0 S503" O12 Coriod = Example: vvar name = prompt ("Enter a name’); document. Write(name); <)_ | List various assignment operators Supported by JavaScript, explain any two with the help of suitable example. Wi ‘Ans | assignment operators supported by JavaScript Operators Meaning Equal to Plus Equal to Minus Equal to Divide Equal to Modulus Equal to Multiply Equal to Example: « |; document. write(num); // num 20 (* += first add the value to the existing value of the variable then assign it the new} list Explain any 2 “1M a} Differentiate between sh and push) methods of an Array object Aas Shite push 1. shift method is used to delete the f 7. push method is used to insert zer element of an existing array more element at the end of an exist 2 Syntax arrshift(; n2,..elementns Example 3 Example: MAHARASHTRA STATE BOAO OF TECHNICAL EDUCATION (autor) asonec. 2700172073 carted) Page No:2 | 24 MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (futonemous) (iso/iec-27001-2018 Certified) €} | State the meaning of ‘Defining a function". Explain with the help of an example vy ‘Ans | « A function is a block of code that takes some input to perform some ¢ Explanation ‘computation, 1™ * The main purpose of the function is to put commonly used or repeatedly Example: 1 task in a function, so instead of writing the code again and again we can) = M instead. The function can be defined as followed: syntax: function fane_name(parameter! ,parameter?,....parametem) iicode } Example: 1) | Give syntax of and explain the use of small “with” clause, 2M ns | “with” clause is used to directly access the properties and method of an object. Explanation Syntax: with (object) ‘Syntax- 1M { JJobject } Example 9) Witlithe help of suitable example explain the Date object and any two methods 2M Date object. Ans | =Date™ object [s used when, we want to perform some operation on date, thas | Explanation- method which helps you performs some task related to date, 1M Example Example: 1 Page No: 3 | 24 MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Gstonomaus)| (asonec-27001-2013 Certiied) ‘Attempt any THREE of the following: T2M a Write a JavaScript that accepts a number and displays addition of digits of that number in a message box. aM ‘Ans it number"); //accept number from user Relevant code- 4M 8) Describe the navigator object in JavaScript. Describe the methods of navigator object which is used to display browser name and version. aM ‘Ans ‘© Navigator object isa representation of user's browser ‘Navigator is an object of window. » Methods of navigator object- Only one method is supported by Navigatg Object. i) javaEnabled()- returns true if the browser has java enabled + We use appName to display browser name. appName is a property of navig + appName property returns browser name. + We use appVersion to display browser version. appVersion is a prope! navigator. + appVersion property returns browser version. + Example Explanation - 2M Method ~ 2 M Page No: 4 | 24 MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (eutonomaus)| (asoniec- 27001-2018 Certified) DD) Give syntax of and explain for-in Toop in javascript with the help of suitable example. aM ns Forin Loop: Syntax For(x in object){ H1code to be executed ) ‘+ For-in loop is used to loop through the properties of an object. + In syntax, variable represents the property name, and object is the object! iterated. «It’s handy for tasks like accessing or manipulating object properties Example: Explanation = 2M Syntax-1M. Example-1 M gD Write an HTML script that accepts Amount, Rate of interest and Period from user. When user submits the information a JavaScript function must calculate and display simple interest in a message box. (Use formula S.l. = PNR/100) aM ‘Ans oR shead>

Principal Amount:

Rate of Interst:

button onclick="interest()"> Simple Interest Output: Principal Amou {i087 Pesiod in Year =, SET Rate of Interst: wurw.w3schools.com says. Page No: 6 | 24 MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (autonomous) asonec- 27001-2013 Certined) \itempt any THREE of the following: 12M ‘@)__| Write an HTML Script that displays the following webpage output The user enters two numbers in respective text boxes, Write a JavaScript such that when user clicks "add’, a message box displays sum of two entered numbers, if the user clicks on "sub”. Message box displays subtraction of two numbers and on clicking “mul” the message box displays multiplication of two numbers. Designing and calling function in onClick()- 1M Writing function for add,sub,mul- 3M ns) he

Second Number: Add
Email ID is

Page No: 9 | 24 MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (autonomous) (iS0/IEC. 27001-2018 Certified) ] Output: First Name: [mahak Domain Name: zita.eduin mahak @zita eduin ©) __ Differentiate between substiing() and subst) method of a string class. Give aM Suitable example of each. ‘Ans Parameters Substring”) SUBST) Use It is used to extract th I is used to extract a part 3 points-3M specified substring within | the string Example-1M string ‘Syntax | strsubstring(start, end), | strsubstr(start, len}; Parameters| Its parameters are the stj It takes parameters as start and end position of th index of the part which substring that we want | want to extract and the leng extract. till which we want to extra the string part. index ‘This method cannot hand This method can hand negative indexes negative indexes. Example | | var a="Javascript document. write( i | document.write | Output: Using substring)=vase Using substr()=vascri | State what is @ cookie? Explain Ws need. State characteristics of persistent aM cookies. Page No: 10 | 28 MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION var re = new RegExp( "MSBTE’,"g" ) var result = re.exec( str); if(result=="MSBTE") { document.write(’patter is found” } else { document.write(‘pattern is not found’); } = ('sonec-£7001"20%3 cetteg) ‘Ans | Cookie: Definition-1M Cookies are small text files that websites use to store information on a user's c: or device. Cookies can be used for a variety of purposes, such as remembering | Need-1M preferences, tracking their behavior on a website, and enabling personalized adve . Charactristics: ‘There are two main types of cookies: session cookies and persistent cookies. | 2M Need of Cookie: Cookies are built specifically for web browsers to track, personalize and information about each user's session. A “session” is the word used to define the amor of time you spend on a site. Cookies are created to identify you when you visit website. Characteristics of persistent cookies: + Persistent cookies can be used to store information that needs to be 4 across multiple browsing sessions, such as login credentials and lal preferences. + Persistent cookies can be used to track a user's behavior on a website ov! which can be used to personalize the user's experience. ‘+ Persistent cookies can be used to remember a user's preferences, such preferred layout or font size. ‘Attempt any THREE of the following: 12M a) | Write a JavaScript that accepts a siring and searches for the pattem aM "MSBTE® in the given string using regular expressions. If the pattern is found, JavaSeript will display that "Patter is found” else display "Pattem is not found’. ns | ‘cept string: 1M JavaScript RegExp exec Methods/title> </head> Correct <body> RegEx-2M <script type = "ext/javascrpt’> Condition ‘var str= prompt(‘Enter a string’); checking-1M Page No: 11 | 24 MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION autonomous) (asonec- 27001-2018 Certified) </script> </body> Lsthtml> b) _ List and state various properties of a window object. Write a JavaScript that aM ‘opens a new popup window with message WELCOME To SCRIPTING" [when the page loads and a new popup window displaying message "FUN WITH SCRIPTING when the page unloads ‘Ans | Window Qbject Properties properties of. window Document [It returns the document object for the window (00M). Frames _|Itreturns an array of all the frames including iframes in the curre ig onload window. (-1M Closed —_|It returns the Boolean value indicating whether a window has beer [closed or not. calling History [It returns the history object for the window. onunload()- ™ innerHeigh{ It sets or returns the inner height of a window's content area. innerWidth| It sets or returns the inner width of a window's content area valid function Length _|Itreturns the number of frames in a window. definition1M Location [It returns the location object for the window. Name [It sets or returns the name of a window. Navigator |It retums the navigator object for the window. Opener _ [It returns a reference to the window that created the window. outerHeigh| It sets or returns the outer height of a window, including toolbars/scrolibars, outerWidth] It sets or returns the outer width of a window, including toolbars/scrolibars, Parent _|It returns the parent window of the current window. Screen [It returns the screen object for the window. screenX |Itretums the X coordinate of the window relative to the screen screen¥ _|Itretums the Y coordinate of the window relative to the screen. Self Itreturns the current window. Status [It sets the text in the status bar of a window. Top It returns the topmost browser window that contains frames. Page No: 12 | 24 MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (autonomous) (asoviec- 270017018 Certified) Cade: <html> <body onloa SCRIPTING’) penWinQ” onunload = 'myWindow.document.write(‘FUN WIT] <script> var myWindow, function openWin() { myWindow = window.open(", "myWindow", ‘width=200,height=100"), myWindow.document.write("<p>WELCOME TO SCRIPTING</p>"); } function closewin() { myWindow.close(); alert("Fun with SCripting’); } </script> </body> </html> Output: WELCOME TO SCRIPTING ©) | Write an HTML script that displays names of different brands of Laptop and aM an image by default as a ————J + HP Image + DELL ___} When the mouse moves over the specific brand name the script must display the image of respective Laptop in the adjacent box. ‘Ans | Code: Designing of form-1M <html> <head> Any relevant Page No: 13 | 24 MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (furonemous) (iso/iec- 27001-2013 Certiied) <title> text rolloverss/title> <script> dacument.clr="; , </script> </head> <body> <table border=" <tbody> str valign="top"> width="100%"> <td><H2><ul><li> <a onmouseover="document.clr.sre=\w.png"> <b><u>Lenovo</u></b></a></li> <li><a onmouseover="document.clr.src> <b><u>HP</u></b></a></li> <li><a onmouseover="document clr.src='dell.png"> <b><u>DELL</u></b></a></li></ul> </H2> </td> <td widt <a><img height: </tr> </tbody> </table> </body> </html> ip-png”"> ‘w.png’ width=400" name="clr’></a></td> Output: When mouse over to HP. hp laptop image will displayed. Togic-aM Page No: 14 | 24 MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (futanemous) (aso/iec- 27001-2018 Certified) a) _| Give Syntax of and explain the use of SetTimeOutl) function with the help of aM suitable example. [Ans Use of setTimeout() Use of SetTimeOut()- The setTimeout() method executes a block of code after the specified time, The) 7M executes the code only once. Syntax-IM ‘The commonly used syntax of JavaScript setTimeout is: Example2M setTimeout(function, milliseconds) Its parameters are: * function - a function containing a block of code + milliseconds - the time after which the function is executed The setTimeout() method returns an intervallD, which is a positive integer. Example: Display a Text Once After 3 Second <script> function greet() { -document.write(Hello world’); setTimeout(greet, 3000); document.write("This message is shown first’); </script> Page No: 15 | 24 MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (futonemous) (asoniec- 27001-2018 Certified) Th the above program, the setTimeout() method calls the greet() function afta milliseconds (3 second) Hence, the program displays the text Hello world only once after 3 seconds. State the use of hiding the JavaScript. Explain the steps needed to accomplish tq describe the process. aM You can hide your JavaScript trom a visitor by storing itin an external fle on you server. The external file should have the js file extension. The browser then ca external file whenever the browser encounters a JavaScript element in the web you look at the source code for the web page, you'll see reference to the external but you wont see the source code for the JavaScript webpage. htm! <html> <head> <script ste="mycode,js" languages="javascript’ typ </script> <body> <h3> Right Click on screen, Context Menu is disabled</h3> </body> </html> mycodejs window.onload=function { document. addEventListener(‘contextmenu’, function(e) { epreventDefault(); ), false); ) fext/javascript’> Use2M Steps with code-2M a) | Write a JavaScript that demonstrates use of floating menu alongwith ‘Attempt any TWO of the following: respective HTML script. 12M eM ns Code: <htini> <title>Examples/title> <style> body { background-image: url(/pix/samples/bg1 gif’) } main { margin-bottom: 200%; } Floating-menu { ny relevant logic or example-6M. Page No: 16 | 24 MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION a yomous) (etn = USOVIEC 27001-2013 Certified) font-family: sans-serif, background: yellowgreen; padding: 5px; ‘width: 130px; index: 100; Pest: ee -floating-menu a, -floating-menu h3 { font-size: 0.9em; display: block; margin: 0 0.5em; joo </style> <main> <peSoroll down and watch the menu remain fixed in the same position, as thd was fioating.</p> <nav class='floatingmenu'> -<h3>Floating Menus/h3> _sub.txt">C</a> “++_sub.txt'>C+#</a> <a href="java_sub.txt">Java</a> <a href="python_sub.txt'>Python</a> </nav> </main> Output: Ae 0 Gini Ystte Nie Soughiews oma pal El Se ee | 8) Form regular expressions for following eM Page No: 17 | 24 MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Gutsnomaus)| (asonec-27001"72018 Certified) 1) Walidation of email address. ii) Validation of adhaar card. Format is dddd- dddd - ddd (ii) Validation of phone number. Format is (ddd) -(ddddedddd) ‘Ans | 1) Regular expression for Validation of email address: ‘Any valid regex for var validRegex = /*fa-zA-Z0-9.1#9%8'*+/-2"_{)~-}+@la-zA-Z0-944(?.\a-2zA-Z0- | emailed-2M os ae Any valid regex for li) Validation of adhaar card Format is adhaar card: dddd - ddd - ddd 2M Regular expression for Validation of adhaar card ee /*{2-9}1}[0-9](3)\s[0-9]¢4)\s{0-9]{4}8/gm phone no-2M il) Validation of phone number. Format is (ddd) -(dddddddtc) Regular expression for Validation of phone number: var re = /*(\+]210210-9}(3)D)-\s\.1210-9]13)E\s\.1210-9)4,6}S/im's Page No: 18 | 24 a MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION i (@utonomaus) (aS0/EC-27001-2013 Certified) a sive IavaSrpt Such that oM (6) Write TNL and respecte is Co Wetegetms tee eSRDONGS ag: cevecraeversct: (__] tea ()corree | [—] sort prin (i) When a beverage is selected @ dropdown list with options as below pearson page sete 8) APTEA” option i ch n (2) AE-TEA" opi <ropdown lst contains Mik tea Block tea (©) _If-COFFEE” option is selected dropdown list contains. Cayuccino Late Expression (©) _1f°SOFT DRINK™ option is selected dropdown list contains MAAZA SPRITE COCA-COLA ‘Ans | Code: Designing of <html> form-2M <body> Shem Any relevant -<script type="text/javascript’> function modifyList(x) with(document.forms.myform) optionList{0} valu optionList{1}.te optionList{1] valu optionList{2] text optionList[2] valu optiontist{0] valu script-4aM Page No: 19 | 24 22519 Model Answe... + MAMARASHTRA STATEBOARO OF TECHNICAL EDUCATION. prem asonge. 276032073 Ceated) TH ‘optionList{ i] text: ‘optionList{i} valve optiontist{2] text="Expressior’; coptiontist2} val } iffc==3) { optiontistd} ted ‘option ist{0} val optionList{1} text="s optiontst{} value: ‘optionList{2].text="COKA-COLA’, coptiont ist] val ) } y </script> <thead> body <form name='myform’ action=" stable><tractd> Select Beverage: </td><td> <input type="checkbox’ _name='gp1" value= ‘method='post'> <select name="optionList” size="3"> <option value=1>Kiwi <option value=7=>Pine-Apple <option value=1>Apple </tr> </table> </select> </form> <tbody> </htmi> Output: onciick="modifyListithis.vaiue)'> TEA GER, Wreweheckbox’ nemewtypt" values? onclckstmoctyLiettttavabig <input type="checkbox’ name="grp!” value=3_onclick="modifyList(this. value SOFT DRINK <itd></tro</table> checked="trd [MAMABASHTDA STATE BOAO OF TECHNICAL EDUCATION. ‘utoromaua (asonsc. 57004" 2073 Certied) Page No: 20 | 24 {Gutoromaus) MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION. cd (@sonec. 27001” 2013 Certified) O TEA Select Beverage: @ COFFEE > SOFT DRINK (Capaccino ~ ‘Late (Expression | ‘itempt any TWO of the following: 12M a) _ Listand explain any six form events eM Ans One event _ with [ Event Handler] Description explanation- 1M each ‘enfocus When the user focuses on an element ‘ensubmit ven the user submits the form onblur "When the focus is away from a form element (The onblur everi ‘occurs when an object loses focus.) ‘anchange When the user modifies or changes the value oF a form elemei [eydown [The event occurs when the use singakey keypress The event occurs when the user presses a key keyup The event occurs when the user releases a key ‘onclick Fires on a mouse click on the element ‘endbiclick | Fires on a mouse double-click on the element ‘enmousedown | Fires when a mouse buttons pressed down on an element ‘enmousemove | Fires when the mouse pointer is moving while itis over an eer ‘onmouseout | Fires when the mouse polnter moves out of an element ‘enmouseover | Fires when the mouse pointer moves over an element ‘onmouseup Fires when a mouse button is released over an element ‘enwheet Fires when the mouse wheel rolls up or down over an element’ “oncontextmenu | oncontextmenu event occurs when the user right-clicks on an element to open the context men b) | Write @ JavaScript that sets crawling status bar message to the webpage. eM Message is ‘Welcome to the Mystic World of JavaScript’, The message must start crawling when the webpage gets loaded. Ans <hitmi> ‘Any relevant <head> script-6M title>Scrolling Text «

i)Design frameset tag for representing following layout Frame i“ ™| Frame 3 ii) List any three properties of regular expression objects and state their use. 6M ‘Ans i) Code: «title>Create a Framec/title> "10%,*" border frame sre="frame1.htm|"> red" noresize> iy correct him code-3M ii) 3 properties with use-3M each Page No: 22 | 24 iis MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Gutonomaus) (asonec- 27001-2013 Certified) J shead> tle> JavaScript RegExp ignoreCase Propertys/title> ('
Test2-ignoreCase property is set’); Page No: 24 | 24

You might also like