Jump to content

How to Disable Javascript Error?


Recommended Posts

How to Disable Javascript Error in browsers?


To centralize errors in an application use the VCL component ApplicationEvents, example:



procedure TFrmPrincipal.ApplicationEvents1Exception(Sender: TObject;

  E: Exception);


  Mensagem: string;

  Pos1, Pos2: integer;


  if Pos(UpperCase('unavailable database'), UpperCase(E.Message)) <> 0 then

    ShowMessage('Servidor de Banco de Dados Off-Line.')

  else if Pos(UpperCase('is not a valid date'), UpperCase(E.Message)) <> 0 then

    ShowMessage('Data inválida, proceda a correção.')

  else if Pos(UpperCase('key violation'), UpperCase(E.Message)) <> 0 then

    ShowMessage('Houve violação de Chave.  Registro já incluido.')

  else if Pos(UpperCase('Input value'), UpperCase(E.Message)) <> 0 then

    ShowMessage('Campo preenchido com valor não válido. Proceda a correção.')

  else if Pos(UpperCase('is not a valid time'), UpperCase(E.Message)) <> 0 then

    ShowMessage('Hora inválida, proceda a correção.')

  else if Pos(UpperCase('must have a value'), UpperCase(E.Message)) <> 0 then


    Pos1 := Pos('''', E.Message);

    Mensagem := E.Message;

    Delete(Mensagem, Pos1, 1);

    Pos2 := Pos('''', Mensagem);

    Mensagem := copy(E.Message, Pos1 + 1, Pos2 - Pos1);

    ShowMessage('É obrigatório o preenchimento do campo "' + Mensagem + '".');






How to implement this in UniGUI? 


Error in Opera browser..


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...