Loading ...
Sorry, an error occurred while loading the content.

Connect.asyncRequest dont work in IE .. why

Expand Messages
  • rafinha_spy
    function changeCombo(combo, s){ var postData = t= + combo + &id= + s + &random= + new Date().getTime(); var request =
    Message 1 of 3 , Apr 1 10:31 AM
    View Source
    • 0 Attachment
      function changeCombo(combo, s){
      var postData = "t=" + combo + "&id=" + s + "&random=" + new
      Date().getTime();
      var request = YAHOO.util.Connect.asyncRequest("POST",
      "includes/localidade.php", callback = {
      success: function(o){
      if (o.responseText !== undefined)
      if (o.responseText)
      document.getElementById(combo).innerHTML =
      o.responseText;
      },
      failure: function(o){
      if (o.responseText !== undefined)
      return false;
      }
      }, postData);
      return false;
      }
    • tssha
      ... You seem to be missing a few left braces after the first and second if statements, in the success handler. If this does not resolve your problem, please
      Message 2 of 3 , Apr 1 10:43 AM
      View Source
      • 0 Attachment
        --- In ydn-javascript@yahoogroups.com, "rafinha_spy" <rafaelspy@...>
        wrote:
        >
        > function changeCombo(combo, s){
        > var postData = "t=" + combo + "&id=" + s + "&random=" + new
        > Date().getTime();
        > var request = YAHOO.util.Connect.asyncRequest("POST",
        > "includes/localidade.php", callback = {
        > success: function(o){
        > if (o.responseText !== undefined)
        > if (o.responseText)
        > document.getElementById(combo).innerHTML =
        > o.responseText;
        > },
        > failure: function(o){
        > if (o.responseText !== undefined)
        > return false;
        > }
        > }, postData);
        > return false;
        > }

        You seem to be missing a few left braces after the first and second
        "if" statements, in the success handler.

        If this does not resolve your problem, please post the contextual code
        that calls changeCombo(), and any errors reported at runtime.

        Regards,
        Thomas
      • Kah Kah!
        If your element type is SELECT , please try this workaround. From: document.getElementById(combo).innerHTML = o.responseText; To: el =
        Message 3 of 3 , Apr 1 11:03 AM
        View Source
        • 0 Attachment
          If your element type is 'SELECT', please try this workaround.

          From:
          document.getElementById(combo).innerHTML = o.responseText;

          To:
          el = document.getElementById(combo);
          el.innerHTML='';
          el.outerHTML= el.outerHTML.replace('</SELECT>', o.responseText + '</
          SELECT>');

          --
          KahKah!
        Your message has been successfully submitted and would be delivered to recipients shortly.