Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to return an array of values with Ajax using ASP classic
    primarykey
    data
    text
    <p>I'm working with ASP classic and Javascript. I have a javascript function where i use a library to create PDFs, but to get values from database I use AJAX. When I make an AJAX call, how would I return an array or hashmap of values, or even each variable separately back to the function from where I make a call???</p> <p>EDIT: Those values that i want to get from AJAX call, I'd like to use later in the same function to create a pdf.</p> <p>EDIT: </p> <blockquote> <p>function make_me_a_pdf(id, izbor, prejemnik){</p> </blockquote> <pre><code> var ajaxRequest; // The variable that makes Ajax possible! var spr; 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; } } } ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ spr = ajaxRequest.responseText; document.write(spr); } } ajaxRequest.open("GET", "getPrejetoNarPodatki.asp", true); ajaxRequest.send(null); </code></pre> <p>This is the code I wrote to make an AJAX call. In getPrejetoNarPodatki.asp the only thing that is writen is:</p> <blockquote> <p>response.write("tralala") </p> </blockquote> <p>...In this case it saves "tralala" to variable spr and i can use it... My question is how to get more values back so I can use them later in the function make_me_a_pdf() ??</p>
    singulars
    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.
 

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