problem with showDocument

S

SimonSimon

Hello,

I can't make method showDocument to work.

This works:
applet.getAppletContext().showDocument(new
URL("http://www.google.com"), "_self");

But I want to show page from my disk:
applet.getAppletContext().showDocument(new URL(getCodeBase() +
"PanoramaTrain.html"), "_self");
This does not work, it just don't show any page.

Please help, i am in hurry :(
 
A

andrewthommo

SimonSimon wrote:
...
I can't make method showDocument to work.

What with pop-up blockers, you simply cannot
rely on showDocument to work out on the real
World Wide Web at all.
This works:
applet.getAppletContext().showDocument(new
URL("http://www.google.com"), "_self");

But I want to show page from my disk:
applet.getAppletContext().showDocument(new URL(getCodeBase() +
"PanoramaTrain.html"), "_self");
This does not work, it just don't show any page.

Did you check the Java console of your browser?
Please help, i am in hurry :(

Please pay money for consultancy if it is urgent.
OTOH, this is usenet, so 'cool your jets, Sparky'.

Andrew T.
 
M

Mickey Segal

SimonSimon said:
But I want to show page from my disk:
applet.getAppletContext().showDocument(new URL(getCodeBase() +
"PanoramaTrain.html"), "_self");

I can think of two possible problems:
1. File name format - your form may be right but be sure to check.
2. Sometimes you need "Mark of the Web" in your files, which requires a
line like:
<!-- saved from url=(0028)http://www.company_name.com/ -->
to be placed at the start of your HTML file that you want to pop up (the
0028 is the total of characters in the string so if the URL is longer it
needs to be a higher number). I forget when you really need this but this
was one of the workarounds that people needed for some situations when
Windows XP SP2 came out. Searching on "Mark of the Web" should give more
details.
 
M

Mickey Segal

What with pop-up blockers, you simply cannot
rely on showDocument to work out on the real
World Wide Web at all.

Andrew's warning is a good one - he and I spent a lot of time dealing with
the pop-up blocker issue. Since I use signed applets I was able to find a
good workaround, but otherwise it is hard to rely on using showDocument.
 
S

SimonSimon

hello,

i just can't figure it out. Is there maybe another method to change
document in a browser?

Greetings
 
A

Andrew T.

SimonSimon wrote:
....
i just can't figure it out. Is there maybe another method to change
document in a browser?

No other method is necessary for *your* browser. The problem here
is almost certainly security, since your applet (in your browser) can
showDocument a page on the net without problems.

Andrew T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top