You need to display the user input in the Web page so that a cross-site scripting attack will be prevented
You are implementing a Web page that displays text that was typed by a user.
You need to display the user input in the Web page so that a cross-site scripting attack will be prevented.
What should you do?
Which code segment should you use?
You create a Web page that contains drop-down menusthat are defined by using div tags in the following
code.
<div class=”dropdown-menu”>
<div class=”menu-title”>Menu One</div>
<div class=”menu-items” style=”display:none;”>
<div><a href=”#”>Item One</a></div>
<div><a href=”#”>Item Two</a></div>
</div>
</div>
<div class=”dropdown-menu”>
<div class=”menu-title”>Menu Two</div>
<div class=”menu-items” style=”display:none;”>
<div><a href=”#”>Item Three</a></div>
<div><a href=”#”>Item Four</a></div>
</div>
</div>
You need to write a JavaScript function that will enable the drop-down menus to activate when the user
positions the mouse over the menu title.
Which code segment should you use?
Which two actions should you perform?
You are implementing an ASP.NET application that makes extensive use of JavaScript libraries.
Not all pages use all scripts, and some scripts depend on other scripts.
When these libraries load sequentially, some of your pages load too slowly.
You need to use the ASP.NET Ajax Library Script Loader to load these scripts in parallel.
Which two actions should you perform? (Each correctanswer presents part of the solution. Choose two.)
Which code segment should you use?
You create a Web page that contains the following image element.
<img id=”myImage” src=”/image1.png” />
You need to write a JavaScript function that will dynamically change which image is displayed.
Which code segment should you use?
Which code segment should you use?
A Web page includes the HTML shown in the followingcode segment.
<span id=”ref”>
<a name=Reference>Check out</a> the FAQ on <a href=”http://www.contoso.
com”>Contoso</a>’s web site for more information: <a href=”http://www.contoso.
com/faq”>FAQ</a>.
</span>
<a href=”http://www.contoso.com/home”>Home</a>
You need to write a JavaScript function that will dynamically format in boldface all of the hyperlinksin the ref
span.
Which code segment should you use?
Which code segment should you use?
You create a Web page that contains the following div.
<div id=”target”>
</div>
You have a JavaScript array named imageurls that contains a list of image URLs.
You need to write a JavaScript function that will insert images from the URLs into target.
Which code segment should you use?
Which code segment should you use?
You create a Web page that contains the following code.
<script type=”text/javascript”>
var lastId = 0;
</script>
<div class=”File”>
Choose a file to upload:
<input id=”File0″ name=”File0″ type=”file” />
</div>
<input id=”AddFile” type=”button” value=”Add a File” />
<input id=”Submit” type=”submit” value=”Upload” />
You need to provide the following implementation.
Each time the AddFile button is clicked, a new div element is created.
The new div element is appended after the other file upload div elements and before the AddFile span.
Each new element has a unique identifier.
Which code segment should you use?
You need to implement this client-side event
You are building an ASP.NET control.
The control displays data by using a table element with a class attribute value of Results.
The control should expose a client-side event named onrowselectedthat fires when a check box in a table
row is selected.
You need to implement this client-side event.
What should you do?
Which declaration should you use?
You create a Web page that contains the following code. (Line numbers are included for reference only.)
01 <script>
02 function changeColor(c) {
03 message.style.color = c;
04 }
05 </script>
07 <p id=”message”>Welcome!</p>
08 <ul id=”color”>
09 <li>Black</li>
10 <li>Red</li>
11 </ul>
You need to ensure that when the user clicks an item in the list, the text color of the “Welcome!” message will
change.
Which declaration should you use?
Which two actions should you perform?
You are implementing an ASP.NET AJAX page.
You add the following control to the page.
<asp:UpdatePanel ID=”pnl1″ runat=”server” UpdateMode=”Conditional”>
<ContentTemplate> … </ContentTemplate>
</asp:UpdatePanel>
You need update the contents of the UpdatePanel without causing a full reload of the page.
Which two actions should you perform? (Each correctanswer presents part of the solution. Choose two.)