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

Default Text

Submit


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!

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

2 Likes

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:

@ayush.11802702

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.

@ayush.11802702

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: