MCSD Programming in HTML5 with JavaScript and CSS3

Here you have the best Microsoft 70-480 practice exam questions

  • You have 142 total questions to study from
  • Each page has 5 questions, making a total of 29 pages
  • You can navigate through the pages using the buttons at the bottom
  • This questions were last updated on November 16, 2024
Question 1 of 142

DRAG DROP -

You are validating user input by using JavaScript and regular expressions.

A group of predefined regular expressions will validate two input fields:

✑ An email address in a function named validateEmail (for example, [email protected])

✑ A nine-digit number that allows optional hyphens after the second and fifth character in a function named validateSSN(for example, 555555555 or 555-55-

5555)

You need to use the correct expression to validate the input.

Which expression should you insert into each function? (To answer, drag the appropriate regular expression statement to the correct location. Each regular expression statement may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)

Select and Place:

    Correct Answer:

Question 2 of 142

You are developing a customer web form that includes the following HTML.

A customer must enter a valid age in the text box prior to submitting the form.

You need to add validation to the control.

Which code segment should you use?

    Correct Answer: D

    To validate that the input is a valid age, you need to ensure that the value entered into the input field is captured and checked against a regular expression that handles numbers. Option D uses the .val() method to get the value from the input field, which is the proper method for input elements. It then uses a regular expression (regex) to validate that the input is a numeric value, which matches the requirement of validating an age. Despite the presence of the leftover emailPattern.test(userinput) line, it correctly performs the necessary validation to check if the field is not empty and contains a valid numeric value.

Question 3 of 142

You are developing an application that consumes a Windows Communication Foundation (WCF) service.

The application interacts with the service by using the following code. (Line numbers are included for reference only.)

You need to authenticate to the WCF service.

What should you do?

    Correct Answer: A

    To authenticate to the WCF service using jQuery's ajax method, the correct way is to add authentication credentials in the settings object. This can be done by specifying the 'username' and 'password' options within the $.ajax call. This approach directly passes the credentials required for HTTP access authentication. Therefore, adding 'username' and 'password' at line 11 is the correct method for authentication in this scenario.

Question 4 of 142

You are developing a customer web form that includes the following HTML.

Information from the web form is submitted to a web service. The web service returns the following JSON object.

{

"Confirmation": "1234",

"FirstName": "John"

}

You need to display the Confirmation number from the JSON response in the txtValue label field.

Which JavaScript code segment should you use?

    Correct Answer: D

    To display the Confirmation number in the txtValue label field, you need to set its text content. In jQuery, the correct method to set the text content of an element is .text. The correct code segment is: $('#txtValue').text(JSONObject.Confirmation);. This ensures that the Confirmation number from the JSON response is correctly displayed in the label.

Question 5 of 142

HOTSPOT -

You are developing a web application that retrieves data from a web service. The data being retrieved is a custom binary datatype named bint. The data can also be represented in XML.

Two existing methods named parseXml() and parseBint() are defined on the page.

The application must:

✑ Retrieve and parse data from the web service using binary format if possible

✑ Retrieve and parse the data from the web service using XML when binary format is not possible

You need to develop the application to meet the requirements.

What should you do? (To answer, select the appropriate options from the drop-down lists in the answer area.)

Hot Area:

    Correct Answer:

    * accepts : 'application/bint, text/xml'

    accepts:'application/bin,text/xml' to accept only XML and binary content in HTML responses.

    * Use the following condition to check if the html response content is binary: If(request.getResponseHeader("Content-Type")=="application/bint"

    * var request = $.ajax({

    uri:'/',

    accepts: 'application/bint, text/xml',

    datafilter: function(data,type){

    if(request.getResponseHeader("Content-Type")=="application/bint") return parseBint(data); else return parseXml();

    },

    success: function (data) {

    start(data);

    }

    });