Update variable after ajax request

Update variable after ajax request

Hi. I have a variable which takes the height of a div.

I want to update this variable after a specific ajax request is made. I tried adding the variable again after the ajax request but it isnt updating it.

Could someone possibly give me an example of how I could do this?

Thank you