This invention discloses a preparation method for biocompatible rapid-gelating hydrogel. Wherein, hydrogel is formed by rapid chemical-crosslinking using the mixing and chemical-crosslinking reaction under specified conditions between several active compound components. The preparation method comprises the following steps: (1) The solution containing biocompatible thiolated macromolecular derivatives (component A) and biocompatible thiol reactive crosslinking agents (component B) mutually mix to form reactive mixture with specified crosslinking conditions (2) the reactive mixture forms the hydrogel. The invention also discloses a preparation method for novel rapid-gelating hydrogel spray and an application in medical field. This invention has the advantages of good biocompatibility, no by-products, good stability, convenient use, small amount of raw materials used, suitable for many medical application, etc..