The given Ajax code is not working with if statement.Please explain about these

Default Text


when i type the above code as given in javascript module of training,it doesnt work.
but when i remove the if conditions it works properly.i want to know the reason

it works,if the conditional statement is not present…
Please Help!

In your if condition statement Change the code (this.readyState)… there is s instead of S.


i am also not getting results, please help me

Your line document.getElementById… is not in one line. Can you put the .first_name; continuing it above?

Your window looks like it has space on the right side. Try once.

this solution does not work for me pls look into my code :face_with_monocle:


Send the code over here rather than the screenshot.

Use </> to insert text in form of code. You can find it on the upper bar, when you click on ‘Reply’ to type your text on this forum.

We can have a better look at your code then.


One error that I already see is responceText in line 19. Correct it to responseText.

In case, you still don’t get the desired results, send the complete code (copy-paste with code tag).

Thank u Akshayan that was helpful and solved my problem :+1: