How can we know which alleles are together on a chromosome?
Your headline question:

How can we know which alleles are together on a chromosome?

is not quite the same as the question at the bottom of the body of your post:

how we can get any information as to whether genes are on the same chromosome or not from this crossing

These questions are different in two ways that matter: (1) the second question is asking about a single crossing, the one shown in the diagram, and (2) the second question asks about knowing if the genes are on the same chromosome or not, whereas the first asks if the genes (I presume, it says &quot;alleles&quot;) are &quot;together on a chromosome&quot; (depending on how you take that phrase).
On difference (1): the single crossing in the diagram does not give information about distinguishing gene locations, but the Khan Academy page you got this from goes on to describe further crossings using the flies created in the first crossing, and those crossings can show information about gene locations.
On difference (2): I would take the genes being &quot;together on a chromosome&quot; to mean &quot;linked to each other&quot;, that is close enough to each other on a single type of chromosome to tend to stay together during recombination events.  Maybe you meant &quot;on the same chromosome&quot;, but that is, importantly, a different thing.  Recombination testing cannot tell you if genes are on the same or different chromosomes; it can only tell you if they are on the same chromosomes and are close enough together that recombination will not sort them randomly, but rather tend to sort them together.  If they are far apart, the genes will stay together or be separated by recombination with equal probability, which is the result that also happens when genes are on different chromosomes.
So, the full procedure that is described on the Khan Academy page will show how much recombination you get in the fly grand-offspring.  If you get few recombinant forms compared to the number of parental forms, then the genes are close together on the same chromosome.  If you get equal numbers of recombinant and parental forms, it indicates that is not the case, and therefore the genes are either on separate chromosomes or so far away on one chromosome that recombination has full effect and randomly separates them.