  Relativistic electrons moving into a highly tangled magnetic field emit
jitter radiation. We present a detailed computation of the jitter radiation
spectrum, including self-absorption, for electrons inside Weibel-like shock
generated magnetic fields. We apply our results to the case of the prompt and
afterglow emission of gamma-ray bursts. We show that jitter emission can
reproduce most of the observed features with some important differences with
respect to standard synchrotron, especially in the frequency range between the
self-absorption and the peak frequency. We discuss the similarities and
differences between jitter and synchrotron and discuss experiments that can
disentangle the two mechanisms.
