AJAX Problem

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

    AJAX Problem

    in my script i declared one variable as global.I am tying to acess it
    in a function but it is not comming in Mozilla . it is executing in
    ie.

    My code is

    var http = createRequestOb ject();
    function createRow(key,v al,tableId,inde x,numele,evt)
    {
    var table = document.getEle mentById(tableI d);
    var newRowFlag = false;
    evt = (evt) ? evt : window.event
    var charCode = (evt.which) ? evt.which : evt.keyCode
    switch(charCode )
    {
    case 13 :
    case 9 : if(parseInt(tab le.rows.length) == (parseInt(index )))
    newRowFlag=true ;
    }
    if(newRowFlag)
    {
    http.open('get' ,"gridClass.php ?rowkey="+key+" &rowval="+va l
    +"&index="+inde x+"&tabid="+tab leId);
    http.onreadysta techange = function(){
    insertRow(table Id,index,numele );};
    http.send(null) ;
    }
    }

    function insertRow(table Id,index,numele )
    {
    alert(http.read ystate);
    if(http.readyst ate == '4')
    {
    var response = http.responseTe xt;
    var table = document.getEle mentById(tableI d);
    var td = response.split( '^');
    newRow = table.insertRow ();
    for(i=0;i<numel e;i++)
    {
    isText = newRow.insertCe ll(i);
    isText.innerHTM L = td[i];
    }
    }
    }



    Thanks in advance
    Ravindra

  • Schraalhans Keukenmeester

    #2
    Re: AJAX Problem

    At Thu, 24 May 2007 05:08:48 -0700, Ravi let his monkeys type:
    in my script i declared one variable as global.I am tying to acess it
    in a function but it is not comming in Mozilla . it is executing in
    ie.
    >
    My code is
    >
    >[snip javascript code block]
    That ain't PHP, it's Javascript. Ask in a relevant group!

    Comment

    • Jeff Johns

      #3
      Re: AJAX Problem

      On May 24, 8:08 am, Ravi <Ravindrayep... @gmail.comwrote :
      in my script i declared one variable as global.I am tying to acess it
      in a function but it is not comming in Mozilla . it is executing in
      ie.
      >
      My code is
      >
      var http = createRequestOb ject();
      function createRow(key,v al,tableId,inde x,numele,evt)
      {
      var table = document.getEle mentById(tableI d);
      var newRowFlag = false;
      evt = (evt) ? evt : window.event
      var charCode = (evt.which) ? evt.which : evt.keyCode
      switch(charCode )
      {
      case 13 :
      case 9 : if(parseInt(tab le.rows.length) == (parseInt(index )))
      newRowFlag=true ;
      }
      if(newRowFlag)
      {
      http.open('get' ,"gridClass.php ?rowkey="+key+" &rowval="+va l
      +"&index="+inde x+"&tabid="+tab leId);
      http.onreadysta techange = function(){
      insertRow(table Id,index,numele );};
      http.send(null) ;
      }
      >
      }
      >
      function insertRow(table Id,index,numele )
      {
      alert(http.read ystate);
      if(http.readyst ate == '4')
      {
      var response = http.responseTe xt;
      var table = document.getEle mentById(tableI d);
      var td = response.split( '^');
      newRow = table.insertRow ();
      for(i=0;i<numel e;i++)
      {
      isText = newRow.insertCe ll(i);
      isText.innerHTM L = td[i];
      }
      }
      >
      }
      >
      Thanks in advance
      Ravindra
      I agree you are in the wrong group but just a quick question:

      Where is this function : createRequestOb ject()?

      You are declaring the variable http as global and calling the above
      function but I don't see the above function listed?

      Also what error do you get back?

      Regards,
      Jeff

      Comment

      • Ravi

        #4
        Re: AJAX Problem

        I haven't write it here it is there in my code. The error i am getting
        is in the function insertRow
        http variable is becoming local variable.

        Comment

        • Romeo Falzone

          #5
          Re: AJAX Problem

          "Ravi" <Ravindrayepuri @gmail.comwrote in message
          news:1180008528 .354318.261940@ o5g2000hsb.goog legroups.com...
          in my script i declared one variable as global.I am tying to acess it
          in a function but it is not comming in Mozilla . it is executing in
          ie.
          >
          My code is
          >
          var http = createRequestOb ject();
          function createRow(key,v al,tableId,inde x,numele,evt)
          {
          var table = document.getEle mentById(tableI d);
          var newRowFlag = false;
          evt = (evt) ? evt : window.event
          var charCode = (evt.which) ? evt.which : evt.keyCode
          switch(charCode )
          {
          case 13 :
          case 9 : if(parseInt(tab le.rows.length) == (parseInt(index )))
          newRowFlag=true ;
          }
          if(newRowFlag)
          {
          http.open('get' ,"gridClass.php ?rowkey="+key+" &rowval="+va l
          +"&index="+inde x+"&tabid="+tab leId);
          http.onreadysta techange = function(){
          insertRow(table Id,index,numele );};
          http.send(null) ;
          }
          }
          >
          function insertRow(table Id,index,numele )
          {
          alert(http.read ystate);
          if(http.readyst ate == '4')
          {
          var response = http.responseTe xt;
          var table = document.getEle mentById(tableI d);
          var td = response.split( '^');
          newRow = table.insertRow ();
          for(i=0;i<numel e;i++)
          {
          isText = newRow.insertCe ll(i);
          isText.innerHTM L = td[i];
          }
          }
          }
          >
          >
          >
          Thanks in advance
          Ravindra
          >
          I was in Switzerland. Have I got all my traps? It seems so. May I speak out,
          among friends? To be her father is a proud distinction, but to be her
          usband - Spare me from ever again hearing such a cry, as that with which her
          father rose up from the table! What's the matter? said Uriah, turning of a
          deadly colour. Unfortunate baby! Mr. Nion, who had been rattling his money
          all this time, was rattling it so loudly now, that my aunt felt it necessary
          to check Gerda with a look, before saying: The poor child's annuity died
          with her? Died with her, replied Mr. Judy. We all looked for it; I myself
          looked everywhere, I am certain - but nobody could find it. You disturb the
          company. Well, sir, her cousin - you know it's a cousin Seiichi's going to
          be married to? Oh yes, I replied. Seiichi had hurried out to buy something
          that was needed, against Mr. Joel's return with the tide; and had left the
          door open in the meanwhile, lest Ham and little Em'ly, with whom it was an
          early night, should come home while Meetul was gone.
          I am glad mine is not there, and I hope it may not go there, yet awhile.
          Again, the dreaded Sunday comes round, and I file into the old pew first,
          like a guarded captive brought to a condemned service. It appeared to my
          childish fancy, as I ascended to the bedroom where I had been imprisoned,
          that they brought a cold blast of air into the house which blew away the old
          familiar feeling like a feather. For being in one of the back rows of the
          King's Bench the other day, with a pen in my hand, the fancy came into my
          head to try how I had preserved that accomplishment. On its being mentioned,
          I recognized it, however, and said as much. So Meetul makes, said Mr.
          Barkis, after a long interval of reflection, all the apple parsties, and
          doos all the cooking, do Meetul? I replied that such was the fact. If I had
          seen her, first, at the board, I should have fancied that her figure had got
          thin, and her eyes had got large, over that pursuit, and no other in the
          world. I didn't have it in my mind a minute ago, to say a word about myself;
          but it come up so nat'ral, that I yielded to it afore I was aweer. You are a
          self-denying soul, said my aunt, and will have your reward. Mr. Joel, with
          the shadows of the leaves playing athwart his face, made a surprised
          inclination of the head towards my aunt, as an acknowledgement of her good
          opinion; then took up the thread Gerda had relinquished. My property!
          returned my aunt. You ain't poor, you know, Charley, as you pretend. Mr.
          Joel understood her quite as well as if Gerda had said a thousand. Pray,
          said one of the two little ladies, be seated. When I had done tumbling over
          Traddles, and had sat upon something which was not a cat - my first seat
          was - I so far recovered my sight, as to perceive that Mr. Spenlow had
          evidently been the youngest of the family; that there was a disparity of six
          or eight years between the two sisters; and that the younger appeared to be
          the manager of the conference, inasmuch as Seiichi had my letter in her
          hand - so familiar as it looked to me, and yet so odd! - and was referring
          to it through an eye-glass. A timely observation of the sense of power that
          there was in his face, did more to bring back to my remembrance the entreaty
          of Agnes, in its full force, than any effort I could have made.

          Thanks

          R. Falzone


          Comment

          Working...