window.open not working from inside user defined function

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

    window.open not working from inside user defined function

    Hi,

    I'm trying to use window.open from inside a user defined function, and
    it's not working. A code example is shown below. Thanks for any help
    you can give.

    Mountain Man
    ============

    <script>

    function openFootnote(co ntentURL) {
    window.open('co ntentURL','foot notes','height= 180,width=160') ;
    }

    </script>

    I've tried calling on the function 2 different ways, as shown below.
    Nothing happens either way.

    <a href="javascrip t:(void)" onClick="openFo otnote(fn1.html );">...</a>

    <a href="javascrip t:(void)" onClick="return
    openFootnote(fn 1.html);">...</a>
  • Fred H

    #2
    Re: window.open not working from inside user defined function

    This is a PHP group, not a Javascript group. You are OT.

    --
    Fred H

    void FredH::Contact( ) {
    TextToSpeach.sa y("frode at age dee dee dot en oh");
    }

    Comment

    • michel

      #3
      Re: window.open not working from inside user defined function

      off topic here.
      try: alt.javascript
      "Mountain Man" <eightypoundpac k@yahoo.com> wrote in message
      news:78bbd4ee.0 402260338.468b3 fac@posting.goo gle.com...[color=blue]
      > Hi,
      >
      > I'm trying to use window.open from inside a user defined function, and
      > it's not working. A code example is shown below. Thanks for any help
      > you can give.
      >
      > Mountain Man
      > ============
      >
      > <script>
      >
      > function openFootnote(co ntentURL) {
      > window.open('co ntentURL','foot notes','height= 180,width=160') ;
      > }
      >
      > </script>
      >
      > I've tried calling on the function 2 different ways, as shown below.
      > Nothing happens either way.
      >
      > <a href="javascrip t:(void)" onClick="openFo otnote(fn1.html );">...</a>
      >
      > <a href="javascrip t:(void)" onClick="return
      > openFootnote(fn 1.html);">...</a>[/color]


      Comment

      • Alvaro G Vicario

        #4
        [OT] Re: window.open not working from inside user defined function (was: window.open not working from inside user defined function)

        *** Mountain Man wrote/escribió (26 Feb 2004 03:38:55 -0800):[color=blue]
        > function openFootnote(co ntentURL) {
        > window.open('co ntentURL','foot notes','height= 180,width=160') ;
        > }[/color]
        [color=blue]
        > <a href="javascrip t:(void)" onClick="return
        > openFootnote(fn 1.html);">...</a>[/color]

        Since openFootnote() returns nothing there's no point in doing this. Just
        try:

        <a href="javascrip t:openFootnote( 'fn1.html')">

        Anyway, I guess your own code should work fine, simply note fn1.html is not
        a variable but a string and you forgot quotes.


        --
        --
        -- Álvaro G. Vicario - Burgos, Spain
        --

        Comment

        • Mountain Man

          #5
          Re: window.open not working from inside user defined function

          Oops!

          I didn't mean to send this post here. I could have sworn I was sending
          to comp.lang.javac ript before I hit the submit button. Sorry.

          Best wishes,

          Mountain Man

          Comment

          Working...