1) Write html file with one button Read JSON. When a userclicks the button, an AJAX call...
Fantastic news! We've Found the answer you've been seeking!
Question:
1) Write html file with one button "Read JSON". When a userclicks the button, an AJAX call will be made to get the JSON file(register records) created. Received JSON should be parsed into aJavaScript object and the JavaScript object should be displayed onthe web in the following format:
2) Only use the method (see sample below) to make the AJAXcall. Other ajax library is not allowed.
3) Use the below JSON file register records
Transcribed Image Text:
Read JSON Organisations Register list last update: 26/09/2022 organisation: Community friends, 236 Crown Street, Wollongong available services: *1 - Monday, Visual art -> $10 *2- Wednesday, Singing together -> free *3 - Tuesday, Wednesday, My music workshop -> $18 organisation: LCC health, 123A Elizabeth Ave, Liverpool available services: *1 - Friday, Health check -> $12 *2 - Friday, Blood test -> $15 // make ajax query function makeAjaxQuery() { // create an XMLHttpRequest var xhttp = new XMLHttpRequest(); } // create a handler for the readyState change xhttp.onreadystatechange = function() { readyStateChangeHandler (xhttp); // handler for the readyState change function readyStateChangeHandler(xhttp) }; // making query by async call xhttp.open( GET , A04-Task1.json , true); xhttp.send(); { if (xhttp.readyState == 4) { // readyState = 4 means DONE if(xhttp.status == 200) } } { // status = 200 means OK handleStatusSuccess (xhttp); } else { } } // XMLHttpRequest failed function handleStatus Failure (xhttp) { // status is NOT OK handleStatusFailure (xhttp); alert( AJAX request fail ); alert( readyState = + xhttp.readyState); alert( status = + xhttp.status); // XMLHttpRequest success function handleStatusSuccess (xhttp) { alert( AJAX request success ); var jsonText = xhttp.responseText; alert (jsonText); // parse the json into an object var obj = JSON.parse(jsonText); // display the object on the page display(obj); Organisations register Current date: 26/09/2022 Organisation: Community friends Address: 236 Crown Street, Wollongong Available services Days Monday Wednesday Tuesday, Wednesday Visual art Singing together My music workshop Organisation: LCC health Address: 123A Elizabeth Ave, Liverpool Available services Days Friday Friday Health check Blood test Cost $10 free $18 Cost $12 $15 Read JSON Organisations Register list last update: 26/09/2022 organisation: Community friends, 236 Crown Street, Wollongong available services: *1 - Monday, Visual art -> $10 *2- Wednesday, Singing together -> free *3 - Tuesday, Wednesday, My music workshop -> $18 organisation: LCC health, 123A Elizabeth Ave, Liverpool available services: *1 - Friday, Health check -> $12 *2 - Friday, Blood test -> $15 // make ajax query function makeAjaxQuery() { // create an XMLHttpRequest var xhttp = new XMLHttpRequest(); } // create a handler for the readyState change xhttp.onreadystatechange = function() { readyStateChangeHandler (xhttp); // handler for the readyState change function readyStateChangeHandler(xhttp) }; // making query by async call xhttp.open( GET , A04-Task1.json , true); xhttp.send(); { if (xhttp.readyState == 4) { // readyState = 4 means DONE if(xhttp.status == 200) } } { // status = 200 means OK handleStatusSuccess (xhttp); } else { } } // XMLHttpRequest failed function handleStatus Failure (xhttp) { // status is NOT OK handleStatusFailure (xhttp); alert( AJAX request fail ); alert( readyState = + xhttp.readyState); alert( status = + xhttp.status); // XMLHttpRequest success function handleStatusSuccess (xhttp) { alert( AJAX request success ); var jsonText = xhttp.responseText; alert (jsonText); // parse the json into an object var obj = JSON.parse(jsonText); // display the object on the page display(obj); Organisations register Current date: 26/09/2022 Organisation: Community friends Address: 236 Crown Street, Wollongong Available services Days Monday Wednesday Tuesday, Wednesday Visual art Singing together My music workshop Organisation: LCC health Address: 123A Elizabeth Ave, Liverpool Available services Days Friday Friday Health check Blood test Cost $10 free $18 Cost $12 $15
Expert Answer:
Answer rating: 100% (QA)
ANSWER AND STEP BY STEP EXPLANATION Step 1 Create an HTML file and add th... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Quarterly contributions of $1000 will be made to an RESP for 15 years. Assuming that the investments within the plan grow at 8% compounded quarterly, how much will the TFSA be worth after 15 years if...
-
Annual contributions of $1000 will be made to a TFSA for 25 years. The contributor expects investments within the plan to earn 7% compounded annually. What will the TFSA be worth after 25 years if...
-
Certain drastic and far reaching changes will be made to your organization's business policy. Discuss how these potentially unsettling ideas could be communicated to the staff.
-
Being able to identify an industry to use for benchmarking yourfirm's results with similar companies is frequently not easy. Choose a type of business and go to www.naics.com. This Web site allows...
-
In Chapter 7, Thinking Critically exercises 7, 8, and 10, you developed a system sequence diagram for Add a new vehicle to an existing policy. You were also provided a list of classes. Based on the...
-
Refer to Exercise 1. The P-value for fertilizer C was 0.03. Use the Bonferroni correction to produce a reliable P-value for this fertilizer. Can you reject H 0 ? Refer to Exercise 1 An agricultural...
-
Refer to the data for E5-16A. Flowever, instead of the FIFO method, assume Austins Jewelers uses the LIFO method. Requirements 1. Prepare a perpetual inventory record for the watches on the LIFO...
-
Analyzing and Interpreting the Inventory Turnover Ratio Dell Inc. is the leading manufacturer of personal computers. In a recent year, it reported the following in dollars in millions: Net sales...
-
Question 2 Suppose the shares of Mantan Madina Berhad (MMB) is being in the uptrend and believe that it will be in this direction in the short term. Two call options on this stock, both having same...
-
Refer to Problem 8.25 for Stebbins Corporation for Year 1, its first year of operations. Exhibit 8.31 shows the amounts for the Canadian subsidiary for Year 2. The average exchange rate during Year 2...
-
Consider a system formed by two particles moving in 3-dimensional space. Let the positions of the particles be (91, 92, 93) and (94, 95, 96) with respect to a given coordinate system. (a) In the...
-
INCOME STATEMENT Net Sales $22,000,000 Cost of Goods Sold $12,090,000 Gross Profit $9,910,000 Depreciation Expense $1,400,000 S&A Expenses $1,672,000 Operating Income (EBIT) $6,838,000 Interest...
-
John purchased 300 shares of Big Trouble common stock at $25.78 a share in July of 2015. In June of 2016 John buys 3 October 45 puts at 2. If the market of Big Trouble is trading at $33.49 at...
-
Suppose a flashlight has 6.6 10 2 C of charge pass through it during time 0.35 h. What is the rate of the flashlight's energy consumption, in watts, if it operates at a voltage of 3.00 V?
-
Consider two assets A and B for which return distributions can be summarized as follows r AB = 0 What is the risk of the minimum risk portfolio composed of these two Stocks? (Hint: Use...
-
A woman bought 300 shares of stock when the stock cost $46.01 per share. After one year, she sold 100 shares of stock when the price was $70.77 per share. After another year, she sold 200 shares of...
-
Two posts are required to receive full credit for a discussion. First of all you will need to respond to the scenario that is given. You will need to give a complete answer, at least a paragraph,...
-
Define cultural intelligence. Cite the books or journal articles you found in Capella's library. Explain why cultural intelligence is important for HR practitioners and other organizational managers.
-
Mallet Music Company makes custom marimbas and xylophones. Since much of the work on these musical instruments is done by hand, the company uses direct labor hours as its manufacturing overhead...
-
Review the data provided in Exercise 9-1. Metro Industries is considering the purchase of new equipment costing $1,200,000 to replace existing equipment that will be sold for $180,000. The new...
-
Shillington Theatrical Supply is planning to expand its product line to include stage makeup. The expansion will require the company to purchase special mixing equipment at a cost of $111,510. The...
-
The trial balance of Alpha Graphics at October 31, 2007, follows, along with the data for the month-end adjustments. Adjusting data at October 31: a. Unearned service revenue still unearned, \(\$...
-
The unadjusted T-accounts of Investors Brokerage at December 31, 2007 , and the related year-end adjustment data follow. Adjustment data at December 31, 2007. a. Depreciation for the year, \(\$...
-
The unadiusted trial balance of Jen Weaver Insurance at April 30, 2008, follow's on the next page. Adjustment data at April 30, 2008, consist of a. Accrued service revenue, \(\$ 1,600\). b....
Certified Information Systems Auditor CISA Practice Exams 1st Edition - ISBN: B093N4C14G - Free Book
Study smarter with the SolutionInn App