473,494 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 = createRequestObject();
function createRow(key,val,tableId,index,numele,evt)
{
var table = document.getElementById(tableId);
var newRowFlag = false;
evt = (evt) ? evt : window.event
var charCode = (evt.which) ? evt.which : evt.keyCode
switch(charCode)
{
case 13 :
case 9 : if(parseInt(table.rows.length) == (parseInt(index)))
newRowFlag=true;
}
if(newRowFlag)
{
http.open('get',"gridClass.php?rowkey="+key+"&rowv al="+val
+"&index="+index+"&tabid="+tableId);
http.onreadystatechange = function(){
insertRow(tableId,index,numele);};
http.send(null);
}
}

function insertRow(tableId,index,numele)
{
alert(http.readystate);
if(http.readystate == '4')
{
var response = http.responseText;
var table = document.getElementById(tableId);
var td = response.split('^');
newRow = table.insertRow();
for(i=0;i<numele;i++)
{
isText = newRow.insertCell(i);
isText.innerHTML = td[i];
}
}
}

Thanks in advance
Ravindra

May 24 '07 #1
4 1374
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!

May 24 '07 #2
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 = createRequestObject();
function createRow(key,val,tableId,index,numele,evt)
{
var table = document.getElementById(tableId);
var newRowFlag = false;
evt = (evt) ? evt : window.event
var charCode = (evt.which) ? evt.which : evt.keyCode
switch(charCode)
{
case 13 :
case 9 : if(parseInt(table.rows.length) == (parseInt(index)))
newRowFlag=true;
}
if(newRowFlag)
{
http.open('get',"gridClass.php?rowkey="+key+"&rowv al="+val
+"&index="+index+"&tabid="+tableId);
http.onreadystatechange = function(){
insertRow(tableId,index,numele);};
http.send(null);
}

}

function insertRow(tableId,index,numele)
{
alert(http.readystate);
if(http.readystate == '4')
{
var response = http.responseText;
var table = document.getElementById(tableId);
var td = response.split('^');
newRow = table.insertRow();
for(i=0;i<numele;i++)
{
isText = newRow.insertCell(i);
isText.innerHTML = td[i];
}
}

}

Thanks in advance
Ravindra
I agree you are in the wrong group but just a quick question:

Where is this function : createRequestObject()?

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

May 24 '07 #3
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.

May 25 '07 #4
"Ravi" <Ra************@gmail.comwrote in message
news:11**********************@o5g2000hsb.googlegro ups.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 = createRequestObject();
function createRow(key,val,tableId,index,numele,evt)
{
var table = document.getElementById(tableId);
var newRowFlag = false;
evt = (evt) ? evt : window.event
var charCode = (evt.which) ? evt.which : evt.keyCode
switch(charCode)
{
case 13 :
case 9 : if(parseInt(table.rows.length) == (parseInt(index)))
newRowFlag=true;
}
if(newRowFlag)
{
http.open('get',"gridClass.php?rowkey="+key+"&rowv al="+val
+"&index="+index+"&tabid="+tableId);
http.onreadystatechange = function(){
insertRow(tableId,index,numele);};
http.send(null);
}
}

function insertRow(tableId,index,numele)
{
alert(http.readystate);
if(http.readystate == '4')
{
var response = http.responseText;
var table = document.getElementById(tableId);
var td = response.split('^');
newRow = table.insertRow();
for(i=0;i<numele;i++)
{
isText = newRow.insertCell(i);
isText.innerHTML = 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
May 30 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4283
by: bobzimuta | last post by:
I'm creating a simple AJAX library. It's an object that will return an array containing the response text or xml. I'm trying to find a way to assign the response as a property of the object, but...
31
3070
by: Tony | last post by:
I just noticed that prototype.js is one of the files in the Ajax.NET distribution - I'm pretty concerned about this. Does anyone know if this is the same "prototype.js" that is not well-liked...
5
2193
by: Martin | last post by:
Hello NG, I've been doing some AJAX for a few weeks now. The basics worked fine so far, but now I've got the following problem which I can't solve: With AJAX you typically update/replace only...
3
1668
by: Alok yadav | last post by:
I have an open IP and on that IP our main application is hosted. it uses ajax. in web.config file i have register ajax handlers. there are also other sites or project on that IP. now my problem is...
3
3111
by: equazcion | last post by:
Hi, I have an image reference (IMG) in my page that changes depending on the value of a database field. Clicking the image triggers an Ajax call to change the database field (toggles the field...
7
3147
by: tommurray | last post by:
Hi all Hope someone can help with the problem I am having as it is driving me nuts! I have the below script on my site the problem lies with passing through a url parameter in the below line...
6
5120
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick...
2
3120
by: shivendravikramsingh | last post by:
hi friends, i m using a ajax function for retrieving some values from a database table,and display the values in required field,my prob is that the ajax function i m using is working f9 once,but if...
3
2446
by: willl69 | last post by:
Hi All, Ive been having a problem of late with one of my sites that uses PHP5 / Ajax. The problem is that periodically the ajax functions lock up and it gets stuck in the loading phase of the...
2
1646
by: majidtou | last post by:
Hi , We have an HTML page which is using AJAX. We make an AJAX call which retrieves a table with mutiple rows. We need to extend this functionality. In the table, we want to put a button on each...
0
7119
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6989
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7367
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5453
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4889
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
644
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.