Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 14 of 14
  1. #1
    New Coder
    Join Date
    Feb 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Probable Ajax.updater IE problem

    Hello,

    I am using Prototype.js to implement Ajax.

    My JS code is -->

    Code:
    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 -->

    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.-->

    Code:
    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 ?

  • #2
    New Coder
    Join Date
    Feb 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Anyone please help me .

  • #3
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    New Coder
    Join Date
    Feb 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by russmeyer View Post
    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 ?

  • #5
    New Coder
    Join Date
    Feb 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by russmeyer View Post
    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 ?

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,050
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Append a unique and random query string in the URL.
    Code:
    var pars = 'num='+num+'&showallfiles='+saf
    +'&act=showattachedfilesection&rand=' + new Date().getTime() + Math.random();

  • #7
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    Quote Originally Posted by glenngv View Post
    Append a unique and random query string in the URL.
    Code:
    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?

  • #8
    New Coder
    Join Date
    Feb 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by glenngv View Post
    Append a unique and random query string in the URL.
    Code:
    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.

  • #9
    New Coder
    Join Date
    Feb 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #10
    New Coder
    Join Date
    Feb 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The username has been changed to "guest1" the password is the same.

    username : guest1

    password : tmp123

  • #11
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,050
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Try this:
    Code:
    <a href="#" onclick="getHTML(6556);return false;">6556</a>

  • #12
    New Coder
    Join Date
    Feb 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I got the solution.

    No need to think .

  • #13
    New to the CF scene
    Join Date
    May 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Pankaj,

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

    Thanks
    Ashwani

  • #14
    Gütkodierer
    Join Date
    Apr 2009
    Posts
    2,127
    Thanks
    1
    Thanked 426 Times in 424 Posts
    Not very probable that he'll respond after two years.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •