Note that there are some explanatory texts on larger screens.

plurals
  1. POAJAX call to ASP page to update database record works only once in IE9
    primarykey
    data
    text
    <p>After several pieces of helpful advice from the members of this forum I'm getting closer to solving what should be a simple issue. I'm a complete newbie to AJAX.</p> <p>Can someone please tell me why this piece of code works fine in Firefox 8 but not in IE 9? It works ONCE in IE but not again unless I close the browser and reopen!!??</p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; &lt;!-- //Browser Support Code function ajaxFunction(){ var ajaxRequest; try { // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch(e) { // Internet Explorer Browsers try { ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if (ajaxRequest.readyState == 4) { } } ajaxRequest.open("GET", "disp_processTEXT.asp", false); ajaxRequest.send(null); } //--&gt; &lt;/script&gt; </code></pre> <p>The readystate is left blank as it is copied code which originally assigned a value to a div but I only want to run the database code in the asp page. Presumably this could have been deleted?</p> <p>The code to be run in the asp page is</p> <pre><code>&lt;% Set MyConn = Server.CreateObject("ADODB.Connection") MyConn.Open "dsn=xxx;uid=xxx;password=xxx;" SQLString = "UPDATE dbo_tbl_printing_tempstore SET front_has_text1 = 'YES', front_text = 'help' WHERE id = 106567" MyConn.Execute(SQLString) MyConn.Close Set MyConn = Nothing %&gt; </code></pre> <p>Please help me as this is driving me mad.</p> <p>Many thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload