I use TWebbrowser
in an application Delphi XE7
, but I'm having problems trying to execute javascript
commands.
(OleException ... Can not complete the operation Error: 80020101)
This happens with any function I try to run, either mine or jquery for example, it seems the function does not even execute. The procedure I use to run is as follows: How to call JavaScript functions in a TWebBrowser from Delphi in my case, I have the function:
function colaNota () {
$('#corpo').append($('<div id="' + new_nota_id + '">' + new_nota_bar + '<p>' + new_nota_texto + '</p><div/>').addClass('notas ui-widget-content').css({
left: new_nota_x,
top: new_nota_y }));
controlaBarraMensagens('oculto');
$( ".notas" ).draggable();
$("#corpo").removeClass("inserindo");
$("#sub_indice_mold").removeClass("visivel");
clearNota();
};
In delphi I'm calling it like this:
JSFn := 'colaNota();'; //Assim não funciona
JSFn := 'alert("Assim funciona");';
HTMLWindow.execScript(JSFn, 'JavaScript');