-
Notifications
You must be signed in to change notification settings - Fork 0
Ajax2
- In your cse322 workspace, create a folder named ajax2. Place all the work you do for this assignment in this folder.
- Use the GitHub Markdown API to perform the following functionality for users. The user types in markdown into a textarea element. When the user clicks the transform button, Javascript submits the text to the raw mode GitHub markdown API and renders the result in the Web page. Make requests to the following url: https://api.github.com/markdown/raw.
- Send me an email before the assignment deadline with a link to your workspace. Write ajax2 assignment in the subject line of the email.
Do not display the result in a popup window.
Do not display HTML code; insert the returned HTML into the document so that it is rendered to the user in the normal way.
Solve this problem by using the XMLHttpRequest object that you learned about in the previous assignment. Do not use Ajax facilities of a library such as jQuery. Do not use jQuery or other library to insert the result into the document.
I've left out a lot of details to give you practice with research. However, here is one hint that might help you solve the problem: Suppose result is the id of a div in your page. In this case, you can insert the HTML returned from Github into your Web page using the following.
document.getElementById('result').innerHTML = the-result-string
Based on his experience with this assignment, Kristian Howard recommends the W3Schools tutorial on AJAX.