单项选择题

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.

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:
B.Add the following code to the $(document).ready function on the page:
C.Add the following option to each $.ajax function call:
D.Add the following code to the $(document).ready function on the page:


您可能感兴趣的试卷

你可能感兴趣的试题

1.多项选择题

You are implementing an ASP.NET AJAX page. You add the following control to the page.
You need update the contents of the UpdatePanel without causing a full reload of the page. Which two actions should you perform?()

A.Add the following control before the UpdatePanel.
B.Add the following control within the UpdatePanel.
C.Add an AsyncPostBackTrigger that references Timer1.
D.Add a PostBackTrigger that references Timer1.

2.单项选择题

You create a Web page that contains the following code.

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>

3.单项选择题

You create a Web page that contains the following code.
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?()

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]"); });

  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){ $("", url).append("#target"); });
B.$(imageurls).each(function(i,url){ $("#target") += $("").attr("src", url); });
C.$.each(imageurls, function(i,url){ $("").attr("src", url).appendTo("#target"); });
D.$.each(imageurls, function(i,url){$("#target").append("").src = url; });

5.单项选择题

A Web page includes the HTML shown in the following code segment. 
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"});

6.单项选择题

You create a Web page that contains the following image element.
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"; }

7.单项选择题

You create a Web page that contains drop-down menus that are defined by using div tags in the following code. 

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?()

A.$(".dropdown-menu").hover( function () { $(".menu-items").slideDown(100); },function () {   $(".menu-items").slideUp(100); } );
B.$(".dropdown-menu").hover( function () { $(".menu-items", this).slideDown(100); },function (){ $(".menu-items", this).slideUp(100); } );
C.$(".dropdown-menu").hover( function () { $(this)".slideDown(100); }, function () {  $(this).slideUp(100);  } );
D.$(".dropdown-menu").hover( function () { $("this.menu-title",).slideDown(100); },function () {$("this.menu-title",).slideUp(100); } );

9.单项选择题You are developing a Web page. The user types a credit card number into an input control named cc and clicks a button named submit. The submit button sends the credit card number to the server. A JavaScript library includes a CheckCreditCard function that returns a value of true if the credit card appears to be valid, based on its checksum. You need to ensure that the form cannot be used to submit invalid credit card numbers to the server. What should you do?()

A.Configure the input control to run on the server. On the submit button, add a server-side OnClick handler that calls CheckCreditCard  and  rejects  the form submission if the input is invalid.
B.On the input control,add an onChange handler that calls CheckCreditCard and cancels the form submission when the  input  is invalid.
C.Configure the input control and the submit button to run on the server. Add a submit_OnClick handler that calls CheckCreditCard  and  rejects  the  form  submission  if  the input is invalid.
D.On the form, add an onSubmit handler that calls CheckCreditCard and cancels the form submission if the input  is invalid.

10.单项选择题You have created an ASP.NET server control named ShoppingCart for use by other developers. Some developers report that the ShoppingCart control does not function properly with ViewState disabled. You want to ensure that all instances of the ShoppingCart control work even if ViewState is disabled. What should you do?()

A.Require developers to set EnableViewStateMac to true.
B.Store state in ControlState instead of ViewState.
C.Serialize the state into an Application state entry called "MyControl"
D.Require developers to change the session state mode to SQL Server.