There has been at least one study along these lines that showed it's not the thing, it's obesity+the thing. In this case it was obesity+gestational diabetes=autism.  I suspect that more studies along those lines will come out in the near future, sugar being among them.