READ Free Dumps For Microsoft- 70-480
Question ID 14894 | 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 by using binary format if possible
✑ Retrieve and parse the data from the web service by using XML when binary
format is not possible
You need to develop the application to meet the requirements.
What should you do? (To answer, drag the appropriate code segment to the correct
location. Each code segment 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.)
|
Option A | Answer :
Explanation:
* 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); } });
|
Correct Answer | A |
Explanation
Question ID 14895 | You create an application that sends information to a web service by using the following
code: (Line numbers are included for reference only.)
When the web service returns a non-zero result code, you must raise an exception that
contains the result code.
You need to implement the code that generates the exception.
Which line of code should you insert at line 04?
|
Option A | CustomError.prototype = Error.prototype;
|
Option B | CustomError ["ErrorType"] = Error;
|
Option C | CustomError.customError = true;
|
Option D | Error-constructor = CustomError;
|
Correct Answer | A |
Explanation Explanation: * Object.prototype.constructor Returns a reference to the Object function that created the instance's prototype. Note that the value of this property is a reference to the function itself, not a string containing the function's name. The value is only read-only for primitive values such as 1, true and "test". * The constructor property is created together with the function as a single property of func.prototype. Reference: Object.prototype.constructor