Safari cannot created variable dynamically?

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

    #1

    Safari cannot created variable dynamically?

    I have the following code to open a popup window and pass a value.

    In the main html page:

    var w = window.open("po pup.htm","","wi dth=510,height= 450");
    w.itemIndex = 100; // alert(w.itemInd ex) will show 100

    The popup window will be openned. However,
    in the popup.htm, javascript code

    alert(this.item Index) shows 'undefined', while it shows right value (100 in
    this example) in Firefox, IE.

    How to pass value when using Safari?

    Thanks.


  • Martin Honnen

    #2
    Re: Safari cannot created variable dynamically?



    nick wrote:
    [color=blue]
    > I have the following code to open a popup window and pass a value.
    >
    > In the main html page:
    >
    > var w = window.open("po pup.htm","","wi dth=510,height= 450");
    > w.itemIndex = 100; // alert(w.itemInd ex) will show 100
    >
    > The popup window will be openned. However,
    > in the popup.htm, javascript code
    >
    > alert(this.item Index) shows 'undefined', while it shows right value (100 in
    > this example) in Firefox, IE.[/color]

    What does Safari show for
    window.itemInde x
    ?


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    • nick

      #3
      Re: Safari cannot created variable dynamically?

      All this.itemIndex, itemIndex, window.itemInde x shows "undefined" .

      "Martin Honnen" <mahotrash@yaho o.de> wrote in message
      news:42122b75$0 $24926$9b4e6d93 @newsread2.arco r-online.net...[color=blue]
      >
      >
      > nick wrote:
      >[color=green]
      >> I have the following code to open a popup window and pass a value.
      >>
      >> In the main html page:
      >>
      >> var w = window.open("po pup.htm","","wi dth=510,height= 450");
      >> w.itemIndex = 100; // alert(w.itemInd ex) will show 100
      >>
      >> The popup window will be openned. However,
      >> in the popup.htm, javascript code
      >>
      >> alert(this.item Index) shows 'undefined', while it shows right value (100
      >> in this example) in Firefox, IE.[/color]
      >
      > What does Safari show for
      > window.itemInde x
      > ?
      >
      >
      > --
      >
      > Martin Honnen
      > http://JavaScript.FAQTs.com/[/color]


      Comment

      • Joakim Braun

        #4
        Re: Safari cannot created variable dynamically?

        "nick" <nbdy9.removeth is@hotmail.com> skrev i meddelandet
        news:cut4vv$m0q $1@news3.bu.edu ...[color=blue]
        > I have the following code to open a popup window and pass a value.
        >
        > In the main html page:
        >
        > var w = window.open("po pup.htm","","wi dth=510,height= 450");
        > w.itemIndex = 100; // alert(w.itemInd ex) will show 100
        >
        > The popup window will be openned. However,
        > in the popup.htm, javascript code
        >
        > alert(this.item Index) shows 'undefined', while it shows right value (100[/color]
        in[color=blue]
        > this example) in Firefox, IE.
        >
        > How to pass value when using Safari?
        >
        > Thanks.[/color]

        Perhaps popup.htm renders its content before w.itemIndex is defined?

        --
        Joakim Braun


        Comment

        • nick

          #5
          Re: Safari cannot created variable dynamically?

          Not likely, I added alert(itemIndex ) in the function called by onload and it
          still shows undefined on Safari.
          w.itemIndex should create a public member itemIndex of the object window.

          "Joakim Braun" <joakim.braun@j fbraun.removeth is.com> wrote in message
          news:zmrQd.2424 7$Of5.16072@nnt pserver.swip.ne t...[color=blue]
          > "nick" <nbdy9.removeth is@hotmail.com> skrev i meddelandet
          > news:cut4vv$m0q $1@news3.bu.edu ...[color=green]
          >> I have the following code to open a popup window and pass a value.
          >>
          >> In the main html page:
          >>
          >> var w = window.open("po pup.htm","","wi dth=510,height= 450");
          >> w.itemIndex = 100; // alert(w.itemInd ex) will show 100
          >>
          >> The popup window will be openned. However,
          >> in the popup.htm, javascript code
          >>
          >> alert(this.item Index) shows 'undefined', while it shows right value (100[/color]
          > in[color=green]
          >> this example) in Firefox, IE.
          >>
          >> How to pass value when using Safari?
          >>
          >> Thanks.[/color]
          >
          > Perhaps popup.htm renders its content before w.itemIndex is defined?
          >
          > --
          > Joakim Braun
          >
          >[/color]


          Comment

          Working...