The issue of substituting one’s own ‘alert’ by contriving a jQuery dialog has been debated previously, for instance here :
Custom alert and confirm box in jquery
In that thread Hemant Malpote objected rightly: « But it [the proposed jQuery dialog-based solution] doesn't block the code. [where]As statement[s] after [a Javascript] alert get execute[d] only when 'Ok' [is] press[ed] ». (Letters or words inside brackets were added by me for the sake of clarity.) I should add that this can wholly change the behaviour of a chunk of code.
How can I design a jQuery dialog so that it behaves the way the Javascript alert does, i.e. stops executing until a dismissal button gets pressed ?