window.open

P

PaPa

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-
transitional.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">


*******************
******************
stuff that works ok
*********************
************************



<a href="#" onClick="window.open('Simple_html.htm','simple_html','
width=500, height=500, scrollbars=1, location=1, menubar=1,
resizable=1, toolbar=1, left=20, top=20');">
<img src="pics/nestor.jpg" alt="nestor the nerd" />
</a>



**********************
The htm document Simple_html.htm opens nicely in Firefox. In IE, the
window opens but states that "IE cannot display the web page".

What am I doing wrong?
 
G

GArlington

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-
transitional.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" /



*******************
******************
stuff that works ok
*********************
************************

<a href="#" onClick="window.open('Simple_html.htm','simple_html','
width=500, height=500, scrollbars=1, location=1, menubar=1,
resizable=1, toolbar=1, left=20, top=20');">
<img src="pics/nestor.jpg" alt="nestor the nerd" />
</a>

**********************
The htm document Simple_html.htm opens nicely in Firefox. In IE, the
window opens but states that "IE cannot display the web page".

What am I doing wrong?

I do not think it has anything to do with posted code...
More likely that your page Simple_html.htm has some issues...
The url might help us to help you.
 
E

Evertjan.

wrote on 20 jun 2008 in comp.lang.javascript:
In your window.open call, does the second param contain a space?

e.g. window.open('Simple_html.htm','simple html','...');

If so, this will fail in IE (bug 289)
http://webbugtrack.blogspot.com/2008/06/bug-289-popup-window-name-cant-
have.html


I should verify, but I'm also curious if in the list of parameters, if
the ", ' comma-space works as a delimeter. It would be weird if it
was that picky, but I don't know.

The window name surely cannot harbour a space?

Why should it?

A Javascript variable name or an html ID value cannot have a space.

That is not a bug.
 
Y

yukabuk

Why are you talking about spaces in variables?....he doesnt have a
space in the variable...you can clearly see the code!

<a href="#" onClick="window.open('Simple_html.htm','simple_html','
width=500, height=500, scrollbars=1, location=1, menubar=1,
resizable=1, toolbar=1, left=20, top=20');">
<img src="pics/
nestor.jpg" alt="nestor the nerd" />
</a>




Move on...
 
E

Evertjan.

yukabuk wrote on 20 jun 2008 in comp.lang.javascript:
Why are you talking about spaces in variables?....he doesnt have a
space in the variable...you can clearly see the code!

???

[please always quote on usenet]
 
P

PaPa

Hmmmmm! Because I am just a fledgling javascript hacker, I thought
this answer would be a lot simpler.

Here are some of the things I have tried.

I replaced the file url with another file (both file work well on
their own) to see if there were something in the file name
(Simple_html.htm). Again, Firefox opened both as I would have
expected. Again, my IE opened a window, but would not recognize the
file. In both cases I used (what I think is) relative addressing.

Then I changed the URL to an absolute adress (some outside web page).
This time, both Firefox and IE worked properly.

I am using IE version 7.0.5730.11.

The names include underscores, but no spaces.
 
S

SAM

PaPa a écrit :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-
transitional.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" /


*******************
******************
stuff that works ok
*********************
************************



<a href="#" onClick="window.open('Simple_html.htm','simple_html','
width=500, height=500, scrollbars=1, location=1, menubar=1,
resizable=1, toolbar=1, left=20, top=20');">
<img src="pics/nestor.jpg" alt="nestor the nerd" />
</a>



**********************
The htm document Simple_html.htm opens nicely in Firefox. In IE, the
window opens but states that "IE cannot display the web page".

What am I doing wrong?

- 1st suppress all the spaces in the arguments of window.open()
- then make a Simple_html.htm file that IE can understand
 
P

PaPa

Without spaces in the arguments, IE still fail to open the page, and
Firefox works perfectly.

The code (without any spaces) now looks like this.

<a href="#" onClick="window.open('Simple_html.htm','simplehtml','
width=500,height=500,scrollbars=1,location=1,menubar=1,resizable=1,toolbar=1,left=20,top=20');">


Here is the code for Simple_html.htm. As you can see, it is quite
simple. It does not have a DTD. Would that be required by IE?


<html>
<head>
<title>
My Web Page
</title>
</head>
<body>
A word about viewing html code directly from your browser.
<br/><br/>
Most browsers have a capability to display the "raw" html code which
makes up the web page you are viewing. This is an excellent way to
learn more about html code, especially for simple pages.
<br/><br/>
If you are using a Mozilla (Firefox) browser, there is likely a "view"
option on your menu bar. Select the "view" option, and then select
"page source".
<br/><br/>
If you are using an Internet Explorer browser (IE), there is either a
"view" option on your menu bar, or a "page" option. Both provide the
means to view the page source.

<br/><br/>
Be sure to view the source of all examples to get a better
understanding of the underlying html structure.
</body>
</html>
 
P

PaPa

Well, after staring at this code for hours and trying dozens of
different things, I finally loaded the files to my server. To my
chagrin, I found that both IE and Firefox behave when the files are on
my folder.

So, I'm still left with the question; why wouldn't it work "locally"
for me?

Any thoughts are appreciated, but please keep it simple. I'm a real
novice.

Regards to all,
Pete
 
P

PaPa

Thanks to all for the help on my window.open problem.

Because there are so many things that work on Firefox but not on IE,
and vice-versa, I believed my problem was javascript related.

What I actually discovered was a file name problem.

One of the folders in my "file path" included the "#" symbol. For
some reason, IE choked on that symbol. Firefox handled it ok.

When I loaded the files to my server, the file in the address path
with the "#" was eliminated, so both Firefox and IE worked OK.

For me, the moral is, "no more #s in the file paths" and keep
learning.

Regards,
PaPa
 
S

SAM

PaPa a écrit :
Without spaces in the arguments, IE still fail to open the page, and
Firefox works perfectly.

The code (without any spaces) now looks like this.

with, or without spaces, my IE6 works fine with these codes.
(in local mode)
 
S

SAM

PaPa a écrit :
Well, after staring at this code for hours and trying dozens of
different things, I finally loaded the files to my server. To my
chagrin, I found that both IE and Firefox behave when the files are on
my folder.

So, I'm still left with the question; why wouldn't it work "locally"
for me?

search and find about 'mark of the web' or something like that
(or give rights to your IE about this local file)
 

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,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top