Click here to Skip to main content
16,008,490 members
Home / Discussions / Web Development
   

Web Development

 
QuestionChange the connection string in a WebSite Pin
SIlviaTerzi11-Jun-09 22:39
SIlviaTerzi11-Jun-09 22:39 
AnswerRe: Change the connection string in a WebSite Pin
Aman Bhullar12-Jun-09 0:12
Aman Bhullar12-Jun-09 0:12 
GeneralRe: Change the connection string in a WebSite Pin
SIlviaTerzi12-Jun-09 2:27
SIlviaTerzi12-Jun-09 2:27 
QuestionAsp.net Pin
ipsita bal11-Jun-09 19:48
ipsita bal11-Jun-09 19:48 
AnswerRe: Asp.net Pin
saanj12-Jun-09 0:40
saanj12-Jun-09 0:40 
AnswerRe: Asp.net Pin
Baran M12-Jun-09 1:39
Baran M12-Jun-09 1:39 
AnswerRe: Asp.net Pin
Vasudevan Deepak Kumar17-Jun-09 1:26
Vasudevan Deepak Kumar17-Jun-09 1:26 
Questionissue with Ajax and IE Pin
BeerFizz11-Jun-09 10:14
BeerFizz11-Jun-09 10:14 
I'm using AJAX for the first time and while writing some code I noticed that IE appeared to be miss-behaving.   Attached below is the test case showing the issue.   This appears to fail with IE 6 and IE 7.   Works fine with firefox and chrome.

In the code I have a number of alerts showing the path through the code and everything works ok until (with IE only) the call to the call back function setOutput.   With IE the second time the doAjax script is invoked, setOutput's never called (or at least there is never a ready state of 4).

The way to reproduce this, is to delete IE's temporary internet files (tools/delete browsing history/temporary internet files).   Load the test script test.html.   Then click the "Click here" button and follow the path through.   The first time it works fine and SetOutput is indeed called.   If the button is clicked a second time, setOutput's never called.      You can repeat this procedure (deleting browser history and clicking "click here").

I tried deleting the ajaxObject object to see if that would help, but it did not.

All help appreciated,
Thanks
Phil



<code>

---------------- test.html --------------------------------------

&lt;head&gt;

&lt;script language="javascript" type="text/javascript"&gt;
&lt;!--


var ajaxObj = null;

function getAjaxObj()
{

            alert("getAjaxObj: Getting ajax object.");
            alert("getAjaxObj: req is " + typeof req);

      // native XMLHttpRequest object
      if(window.XMLHttpRequest &amp;&amp; !(window.ActiveXObject)) {
                        alert("1");
            try {
                                    req = new XMLHttpRequest();
                                    alert("1.1");
            } catch(e) {
                                    req = false;
                                    alert("1.2");
            }
      // IE/Windows ActiveX version
      } else if(window.ActiveXObject) {
                        alert("2");
            try {
                        req = new ActiveXObject("Msxml2.XMLHTTP");
                                    alert("2.1");
            } catch(e) {
                        try {
                                    req = new ActiveXObject("Microsoft.XMLHTTP");
                                                alert("2.2");
                        } catch(e) {
                                    req = false;
                                                alert("2.3");
                        }
                        }
      } else {
                        alert("getAjaxObj: Your browser does not support AJAX.");
                        req = false;
            }

            alert("3");
            alert("getAjaxObj: req is " + typeof req);

            return req;
}



function setOutput()
{
      if (ajaxObj.readyState == 4) {
            if (ajaxObj.status != 200) {
                        alert("setOutput: Ajax Error: " + ajaxObj.status);
            } else {
                                    var cType = ajaxObj.getResponseHeader("Content-Type")
                                    alert("setOutput: Ajax content type " + cType);
                                    delete ajaxObj;            // tried doing this to see if it would fix the issue????
            }
      }
}



function doAjax()
{
      ajaxObj = getAjaxObj();
      if (ajaxObj != null) {
            ajaxObj.open("GET", ".../test.php", true);
            ajaxObj.send(null);
            ajaxObj.onreadystatechange = setOutput;
      }
}



//--&gt;
&lt;/script&gt;

&lt;/head&gt;

&lt;body&gt;

            &lt;button onclick="doAjax()"&gt;Click here&lt;/button&gt;

&lt;/body&gt;



------------------- test.php ----------------------------------------------------

&lt;?php
            echo ("Hello World");
?&gt;

</code>
AnswerRe: issue with Ajax and IE Pin
Aman Bhullar11-Jun-09 21:52
Aman Bhullar11-Jun-09 21:52 
GeneralRe: issue with Ajax and IE Pin
BeerFizz12-Jun-09 3:24
BeerFizz12-Jun-09 3:24 
GeneralRe: issue with Ajax and IE Pin
PrestonMB12-Jun-09 12:25
PrestonMB12-Jun-09 12:25 
QuestionHow to give Dynamic path in AjaxUploader control Asp.net Pin
kirti.darji10-Jun-09 19:07
kirti.darji10-Jun-09 19:07 
AnswerRe: How to give Dynamic path in AjaxUploader control Asp.net Pin
Christian Graus10-Jun-09 23:09
protectorChristian Graus10-Jun-09 23:09 
QuestionHi Folks, Positioning gone wrong in Web Developer. Pin
Baeltazor10-Jun-09 9:19
Baeltazor10-Jun-09 9:19 
AnswerRe: Hi Folks, Positioning gone wrong in Web Developer. Pin
Christian Graus10-Jun-09 9:27
protectorChristian Graus10-Jun-09 9:27 
GeneralRe: Hi Folks, Positioning gone wrong in Web Developer. Pin
Baeltazor10-Jun-09 9:38
Baeltazor10-Jun-09 9:38 
GeneralRe: Hi Folks, Positioning gone wrong in Web Developer. Pin
Christian Graus10-Jun-09 10:42
protectorChristian Graus10-Jun-09 10:42 
GeneralRe: Hi Folks, Positioning gone wrong in Web Developer. Pin
Baeltazor10-Jun-09 11:13
Baeltazor10-Jun-09 11:13 
QuestionRe: Hi Folks, Positioning gone wrong in Web Developer. Pin
Baeltazor10-Jun-09 9:41
Baeltazor10-Jun-09 9:41 
AnswerRe: Hi Folks, Positioning gone wrong in Web Developer. Pin
User 171649210-Jun-09 21:37
professionalUser 171649210-Jun-09 21:37 
GeneralRe: Hi Folks, Positioning gone wrong in Web Developer. Pin
Baeltazor11-Jun-09 7:58
Baeltazor11-Jun-09 7:58 
AnswerRe: Hi Folks, Positioning gone wrong in Web Developer. Pin
led mike11-Jun-09 4:49
led mike11-Jun-09 4:49 
GeneralRe: Hi Folks, Positioning gone wrong in Web Developer. Pin
Baeltazor11-Jun-09 7:56
Baeltazor11-Jun-09 7:56 
AnswerRe: Hi Folks, Positioning gone wrong in Web Developer. Pin
Todd Smith11-Jun-09 12:29
Todd Smith11-Jun-09 12:29 
GeneralRe: Hi Folks, Positioning gone wrong in Web Developer. Pin
Baeltazor11-Jun-09 15:56
Baeltazor11-Jun-09 15:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.