Close windows explorer popup using Javascript function in Java code -


how close windows explorer popup using javascript function in java code?

i have close windows explorer popup in java code. using javascript function window.close() close window popup breaking loop.

here piece of code:

  scriptenginemanager manager = new scriptenginemanager();     scriptengine engine = manager.getenginebyname("javascript");    string script = "function winclose() {"+"var close_result =  window.parent.close();"+"" +"document.getelementbyid('close_result').value =   close_result;"+"console.log(\"change box value\");}";     engine.eval(script);     invocable inv = (invocable) engine;     inv.invokefunction("winclose", "window close!!" );  

but giving me exception window not defined.

actually have never used javascript in java code. please me out window close function in javascript.

although have not mentioned hope java code part of applet. in case should use live connect api instead of scriptingenginemanager.

scriptingenginemanager runs rhibno - pure java implementation of javascript language. can use either in applet (running in browser) or not. engine running way absolutely independent on javascript running browser , therefore not know objects injected browser context window or document.

please take on live connect documentation , examples more details. shortly developed netscape technology allows applets communicate page running. therefore package contains name of company.

but please careful: applets obsolete 10 years ago , well-known died technology these days. may advise double check whether indeed want use it? there thin client alternatives - check them.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -