Latest 70-515 Real Exam Download 61-70

Ensurepass

QUESTION 61

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?

A. function changeImage() { myImage.src = "image2.png";

}

B. function changeImage() { document.getElementById("myImage").src = "image2.png";

}

C. function changeImage() { getElementById("myImage").src = "image2.png";

}

D. function changeImage() { window.getElementById("myImage").src = "image2.png";

}

Answer: B

A Web page includes the HTML shown in the following code 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 hyperlinks in the ref span.

Which code segment should you use?

A. $("#ref").filter("a[href]").bold();

B. $("ref").filter("a").css("bold");

C. $("a").css({fontWeight:"bold"});

D. $("#ref a[href]").css({fontWeight:"bold"});

Answer: D


QUESTION 63

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?

A. $(imageurls).each(function(i,url){

$("<img/>", url).append("#target");

});

B. $(imageurls).each(function(i,url){

$("#target") += $("<img/>").attr("src", url);

});

C. $.each(imageurls, function(i,url){

$("<img/>").attr("src", url).appendTo("#target");

});

D. $.each(imageurls, function(i,url){

$("#target").append("<img/>").src = url;

});

Answer: C


QUESTION 64

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.

clip_image002Each time the AddFile button is clicked, a new div element is created.

clip_image002[1]clip_image002[2]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?

A. $("#AddFile").click(function () { var id = "File" + ++lastId;

var item = $(".File:first").clone(true);

$("input:file", item).attr({ id: id, name: id });

item.insertBefore("#AddFile");

});

B. $("#AddFile").click(function () { var id = "File" + ++lastId;

$(".File:first").clone(true).attr({ id: id, name: id }).insertBefore ("#AddFile");

});

C. $("#AddFile").click(function () { var id = "File" + ++lastId;

});

D. $("#AddFile").click(function () { var id = "File" + ++lastId;

var item = $(".File:first").clone(true);

$("input:file", item).attr({ id: id, name: id });

item.insertAfter("input[type=file]");

});

Answer: A


QUESTION 65

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 onrowselected that fires when a check box in a table row is selected.

You need to implement this client-side event. What should you do?

A. $(‘.Results input:checked’).onrowselected = function (e, sender) {

};

B. $(‘.Results input:checked’).bind(‘onrowselected’, function (e, sender) {

});

C. $(‘.Results’).bind(‘onrowselected’, function (e, sender) {

}).click(function (e) {

if ($(e.target).is(‘input:checked’)) {

$(‘.Results’).trigger(‘onrowselected’, [$(e.target)]);

}

});

D. $(‘.Results’).onrowselected($.proxy($(this).find(‘input:checked’), function (e, sender) {

}));

Answer: C


QUESTION 66

You create a Web page that contains the following code. (Line numbers are included for reference only.)

1 <script>

2 function changeColor(c) {

3 message.style.color = c;

4 }

5 </script>

7 <p id="message">Welcome!</p>

8 <ul id="color">

9 <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?

A. <ul id="color">

<li onclick="changeColor(this.innerText);">Black</li>

<li onclick="changeColor(this.innerText);">Red</li>

</ul>

B. <ul id="color">

<li onclick="changeColor(this.style.color);">Black</li>

<li onclick="changeColor(this.style.color);">Red</li>

</ul>

C. <ul id="color">

<li><a onfocus="changeColor(this.innerText);">Red</a></li>

<li><a onfocus="changeColor(this.innerText);">Black</a></li>

</ul>

D. <ul id="color">

<li><a onfocus="changeColor(this.innerText);">Red</a></li>

<li><a onfocus="changeColor(this.innerText);">Black</a></li>

</ul>

Answer: A


QUESTION 67

Corrected :
QUESTION No: 44

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 correct answer presents part of the solution. Choose two.)

A. Add the following control before the UpdatePanel.

<asp:Timer ID="Timer1" OnLoad="Timer1_Tick" runat="server" Interval="3000" /

>

B. Add the following control within the UpdatePanel.

<asp:Timer ID="Timer1" OnLoad="Timer1_Tick" runat="server" Interval="3000" /

>

C. Add an AsyncPostBackTrigger that references Timer1.

D. Add a PostBackTrigger that references Timer1.

Answer: BC


QUESTION 68

You are implementing an ASP.NET AJAX page.

You add two UpdatePanel controls named pnlA and pnlB. pnlA contains an UpdatePanel control named pnlAInner in its content template.

You have the following requirements.

clip_image002[3]Update panels pnlA and pnlB must refresh their content only when controls that they contain cause a postback.

clip_image002[4]Update panel pnlAInner must refresh its content when controls in either pnlA or pnlB or pnlAInner cause a postback.

You need to configure the panels to meet the requirements. What should you do?

A. Set the UpdateMode of pnlA and pnlB to Conditional. Set the UpdateMode of pnlAInner to Always.

B. Set the UpdateMode of pnlA and pnlB to Conditional. Set the UpdateMode of pnlAInner to Conditional, and add AsyncPostBackTrigger elements to its Triggers element for every control in pnlA.

C. Set the UpdateMode of pnlA and pnlB to Always. Set the UpdateMode of pnlAInner to Conditional.

D. Set the UpdateMode of pnlA and pnlB to Always. Set the UpdateMode of pnlAInner to Always, and add AsyncPostBackTrigger elements to its Triggers element for every control in pnlB.

Answer: A


QUESTION 69

You are implementing an ASP.NET AJAX page that contains two div elements.

You need to ensure that the content of each div element can be refreshed individually, without requiring a page refresh.

What should you do?

A. Add two forms to the page.

Add a script manager and an update panel to each form.

Add a content template to each update panel, and move each div element into a content template.

B. Add two forms to the page.

Add a script manager and an update panel to each form.

Add a content template to each update panel, and move each div element into a content template.

C. Add a form and two update panels to the page.

Add a script manager to the form.

Add a content template to each update panel, and move a div element into each content template.

D. Add a form and two update panels to the page.

Add two script managers to the form, one for each update panel.

Add a content template to each update panel, and move each div element into a content template.

Answer: C


QUESTION 70

You create an ASP.NET page.

The page uses the jQuery $.ajax function to make calls back to the server in several places. You add the following div element to the page.

<div id="errorInfo">

</div>

You need to implement a single error handler that will add error information from all page $.ajax calls to the div named errorInfo.

What should you do?

A. Add the following options to each $.ajax function call:

global: true,

error: function (XMLHttpRequest, textStatus, errorThrown){ $("#errorInfo").

text("<li>Error information is: " + textStatus + "</li>");

B. Add the following code to the $(document).ready function on the page:

$("#errorInfo").ajaxError(function(event, request, settings){ $(this).append ("<li>Error requesting page " + settings.url + "</li>"); });

C. Add the following option to each $.ajax function call:

error: function (XMLHttpRequest, textStatus, errorThrown){ $("#errorInfo"). text("<li>Error information is: " + textStatus + "</li>");

}

D. Add the following code to the $(document).ready function on the page:

$.ajaxError(function(event, request, settings){

$(this).append("<li>Error requesting page " + settings.url + "</li>");});

Add the following option to each $.ajax function call:

global: true

Answer: B

Download Latest 70-515 Real Free Tests , help you to pass exam 100%.