Var turns null when I return

I'm sorry if this is a noob question, but I'm trying for a day now without getting any further so I decided to give it a go here.

I've made this function to get some ajax data from a page with a certain 'guid'. my function should give me the html of that page to do something else with.

In the middle of my code, my var result still has all the data, but as soon as I end my function, the var is null.
Does anyone have an idea what I should do?
Thanks in advance!

... Code (JavaScript):

Var turns null when I return

Poster :
Dries .dk