Question: Write a file of JavaScript code calledjs. The login.js file is loaded in the very last line of the element. Whenever the user types into
Write a file of JavaScript code calledjs.
- The login.js file is loaded in the very last line of the element.
- Whenever the user types into an input element with an id of name, send an AJAX GET request to namecheck.php with a parameter named q equal to the contents of the input element.
- The namecheck.php file will reply with a JSON-encoded array.
- If the second element of the array is the integer 1, put the word Good in green into an html element with the id of feedback.
- Otherwise, put the word Bad in red into the html element with the id of feedback.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
