...

View Full Version : Probable Ajax.updater IE problem



pankaj_it09
02-17-2007, 09:42 AM
Hello,

I am using Prototype.js to implement Ajax.

My JS code is -->


function getHTML(num) {
var saf = 0 ;
var num;
if(!num) {
num = document.getElementById('refid').value;
} else {
num = num;
}
var url = '/cgi-bin/tps/search.cgi';
var pars = 'num='+num+'&showallfiles='+saf
+'&act=showattachedfilesection';
var myAjax = new Ajax.Updater( {success: 'placeholder'}, url,
{method: 'get', parameters: pars, onFailure: reportError });
}

The above code works fine in Firefox but not in IE.

What happens in IE ?
The getHTML function is invoked when I click on a link.
When I click on a link the function is called and processing happens
but never stops.

How I know that processing happens ?
By the following code -->



var myGlobalHandlers = {
onCreate: function(){
Element.show('systemWorking');
},
onComplete: function() {
if(Ajax.activeRequestCount == 0){
Element.hide('systemWorking');
}
}
};

Ajax.Responders.register(myGlobalHandlers);

Here is the Perl code which creates the variable $str and returns to
another Ajax(not above) and a placeholder is replaced by the data
below. Notice the getHTML function below.-->


my $i;
foreach $i (0 ..$#selectlist) {
$str .= "<tr>";
$str .= "<td class=\"plogitemselectable\"><a href=
\"#placeanchor\" onClick=\"getHTML($selectlist[$i]{'conid'});\">
$selectlist[$i]{'conid'}</a></td>";
$str .= "<td class=\"plogitemselectable\">$selectlist[$i]
{'arriveDate'}</td>";
$str .= "<td class=\"plogitemselectable\">$selectlist[$i]
{'dbname'}</td>";
$str .= "<td class=\"plogitemselectable\">$selectlist[$i]
{'startDate'}</td>";
$str .= "<td class=\"plogitemselectable\">$selectlist[$i]
{'expiryDate'}</td>";
$str .= "<td class=\"plogitemselectable\">$selectlist[$i]
{'status'}</td>";
$str .= "</tr>";
}
$str .= "</tbody>";
$str .= "</table>";
print $str;

Please tell me what to do so that the JS code runs in IE also ?

pankaj_it09
02-17-2007, 12:33 PM
Anyone please help me .

russmeyer
03-01-2007, 06:57 AM
i would change ur method to 'POST' instead of 'GET' seems like there is a cache issue with IE. the other issue is that i was not able to use ajax.updater to pass back HTML with a table tag. as soon as i remove table tag, it worked. not really what i wanted since the resource asset library for my company and company standards are all based around crappy table structures. make sure u dont have any tables in ur HTML that ur returning if u want this to work in IE.

pankaj_it09
03-02-2007, 05:09 AM
i would change ur method to 'POST' instead of 'GET' seems like there is a cache issue with IE. the other issue is that i was not able to use ajax.updater to pass back HTML with a table tag. as soon as i remove table tag, it worked. not really what i wanted since the resource asset library for my company and company standards are all based around crappy table structures. make sure u dont have any tables in ur HTML that ur returning if u want this to work in IE.

But I want the result in tabular format.

If I remove the table tag then how can I view the data in tabular format ?

pankaj_it09
03-02-2007, 02:59 PM
i would change ur method to 'POST' instead of 'GET' seems like there is a cache issue with IE. the other issue is that i was not able to use ajax.updater to pass back HTML with a table tag. as soon as i remove table tag, it worked. not really what i wanted since the resource asset library for my company and company standards are all based around crappy table structures. make sure u dont have any tables in ur HTML that ur returning if u want this to work in IE.

You may be right that this may be a CACHE issue because when I debugged the script it stopped at a unloadcache function .

Please tell me what to ?

glenngv
03-02-2007, 05:44 PM
Append a unique and random query string in the URL.

var pars = 'num='+num+'&showallfiles='+saf
+'&act=showattachedfilesection&rand=' + new Date().getTime() + Math.random();

BarrMan
03-02-2007, 07:04 PM
Append a unique and random query string in the URL.

var pars = 'num='+num+'&showallfiles='+saf
+'&act=showattachedfilesection&rand=' + new Date().getTime() + Math.random();

Hey, how would it help him?
I heard this thing somewhere about the cache page, is that somehow involved in this?

pankaj_it09
03-05-2007, 05:41 AM
Append a unique and random query string in the URL.

var pars = 'num='+num+'&showallfiles='+saf
+'&act=showattachedfilesection&rand=' + new Date().getTime() + Math.random();

Its not working.

The random number is associated so that the browser doesn't take the cached values.
That is not the problem in mycase.

Please help.

pankaj_it09
03-05-2007, 07:57 AM
Alright I am giving the reproducible case -->

http://netfares.skybirdfares.com/cgi-bin/tps/index.cgi

Please login and then click on Search in the TopMenu .
After that enter "yy test"(don't include double quotes) as the search
text.
The Search results will come and after that click anyone of the links
on the left.

Username: guest

Password: tmp123

You will see that the results don't come after you click the link.
This happens only in IE.
That is the problem .
Please solve it.

pankaj_it09
03-09-2007, 05:13 AM
The username has been changed to "guest1" the password is the same.

username : guest1

password : tmp123

glenngv
03-09-2007, 06:22 AM
Try this:

<a href="#" onclick="getHTML(6556);return false;">6556</a>

pankaj_it09
03-10-2007, 02:50 PM
I got the solution.

No need to think .

ashwanis
05-06-2009, 03:56 PM
Hi Pankaj,

We are facing the same issue, could you pl let us know how did you get this resolved ????

Thanks
Ashwani

venegal
05-06-2009, 04:10 PM
Not very probable that he'll respond after two years.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum