aspose file tools*
The moose likes Applets and the fly likes How to make browser stop loading its contents until applet gets downloaded Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "How to make browser stop loading its contents until applet gets downloaded" Watch "How to make browser stop loading its contents until applet gets downloaded" New topic
Author

How to make browser stop loading its contents until applet gets downloaded

satyanarayana chivukula
Greenhorn

Joined: Apr 21, 2013
Posts: 6
Hi all .


How to make browser stop loading its contents until applet gets downoaded

I tried with document.all
so that all document elements will be loaded by the browser's document object , still unable to figure it out .

Thanks in advance
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41906
    
  63
This is a rather unusual thing to want to do. What is it you're trying to accomplish by doing this?


Ping & DNS - my free Android networking tools app
satyanarayana chivukula
Greenhorn

Joined: Apr 21, 2013
Posts: 6
Hi Ulf Dittmer


In my jsp ,I have a functionality to call applet method which in turn return value that has to be passed to server is a hidden variable .
But this applet has to be downloaded from server.

sometimes may be due to network issues applet is not getting downloaded or not getting loaded into browser, so applet function calling throws javascript exception
element expected on calling

Thanks for suggestions
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41906
    
  63
That's what try/catch is for: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch
satyanarayana chivukula
Greenhorn

Joined: Apr 21, 2013
Posts: 6
try{} catch{} serves to handle exceptions
but I have to call the applet method at any cost.

If I place applet method calling in try , exception would be caught.
but function has to be called , so javascript has to wait until applet gets loaded.


Thank you for suggestions
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41906
    
  63
I don't understand. If the JS calls a method that doesn't exist (like if the applet isn't yet called), some kind of exception would occur. And then you'd use try/catch to deal with that in whatever way is appropriate (maybe by setting a timeout before you try again). So I'm unclear what you mean by "but function has to be called" - you would be calling the function, but possibly not succeed at the first try, but rather at some later try. To me it sounds like that would solve your problem.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to make browser stop loading its contents until applet gets downloaded