window.open

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • PaPa

    window.open

    <?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.dt d">
    <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_h tml.htm','simpl e_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?
  • GArlington

    #2
    Re: window.open

    On Jun 20, 2:35 pm, PaPa <nono...@gmail. comwrote:
    <?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.dt d">
    <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_h tml.htm','simpl e_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.

    Comment

    • webbugtrack@gmail.com

      #3
      Re: window.open

      In your window.open call, does the second param contain a space?

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

      If so, this will fail in IE (bug 289)
      Issue: #289 Affects: IE6, IE7, IE8 Note: Readers are indicating that you can't use dashes in IE either! e.g. 'this-name-fails' When you op...



      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.

      Comment

      • Evertjan.

        #4
        Re: window.open

        wrote on 20 jun 2008 in comp.lang.javas cript:
        In your window.open call, does the second param contain a space?
        >
        e.g. window.open('Si mple_html.htm', 'simple html','...');
        >
        If so, this will fail in IE (bug 289)
        Web Bug Track - A place to track Web bugs... in JavaScript, DOM, CSS, XHTML, HTML in all Web Browsers... Firefox, Internet Explorer, Safari, Chrome, Opera, Konqueror and more.

        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.

        --
        Evertjan.
        The Netherlands.
        (Please change the x'es to dots in my emailaddress)

        Comment

        • yukabuk

          #5
          Re: window.open

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

          <a href="#" onClick="window .open('Simple_h tml.htm','simpl e_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...

          Comment

          • Evertjan.

            #6
            Re: window.open

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

            [please always quote on usenet]

            --
            Evertjan.
            The Netherlands.
            (Please change the x'es to dots in my emailaddress)

            Comment

            • PaPa

              #7
              Re: window.open

              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.ht m). 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.

              Comment

              • SAM

                #8
                Re: window.open

                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.dt d">
                <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_h tml.htm','simpl e_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

                Comment

                • PaPa

                  #9
                  Re: window.open

                  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_h tml.htm','simpl ehtml','
                  width=500,heigh t=500,scrollbar s=1,location=1, menubar=1,resiz able=1,toolbar= 1,left=20,top=2 0');">


                  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>

                  Comment

                  • PaPa

                    #10
                    Re: window.open

                    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

                    Comment

                    • PaPa

                      #11
                      Re: window.open

                      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

                      Comment

                      • SAM

                        #12
                        Re: window.open

                        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)
                        <a href="#" onClick="window .open('Simple_h tml.htm','simpl ehtml','
                        width=500,heigh t=500,scrollbar s=1,location=1, menubar=1,resiz able=1,toolbar= 1,left=20,top=2 0');">
                        >
                        >
                        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>
                        >

                        Comment

                        • SAM

                          #13
                          Re: window.open

                          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)

                          --
                          sm

                          Comment

                          • SAM

                            #14
                            Re: window.open

                            PaPa a écrit :
                            >
                            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.
                            I think it is not the real reason, it is a protection in IE about local
                            files.

                            Don't know what think M$ ! :-(
                            with so bad "security" controls ... :-(

                            See :
                            <http://msdn.microsoft. com/en-us/library/ms537628(VS.85) .aspx>

                            --
                            sm

                            Comment

                            Working...