how can i access .ashx return value in javascript?http://forums.asp.net/t/1798914.aspx/1?how+can+i+access+ashx+return+value+in+javascript+Tue, 01 May 2012 16:49:01 -040017989144960264http://forums.asp.net/p/1798914/4960264.aspx/1?how+can+i+access+ashx+return+value+in+javascript+how can i access .ashx return value in javascript? <p>Hi,</p> <p>I need to&nbsp;access .ashx return value in javascript?</p> <p>please help me.....</p> 2012-05-01T16:32:37-04:004960287http://forums.asp.net/p/1798914/4960287.aspx/1?Re+how+can+i+access+ashx+return+value+in+javascript+Re: how can i access .ashx return value in javascript? <p>Reference :&nbsp;</p> <p><a href="http://stackoverflow.com/questions/5561791/jquery-ajax-has-a-problem-getting-return-value-from-ashx-handler">http://stackoverflow.com/questions/5561791/jquery-ajax-has-a-problem-getting-return-value-from-ashx-handler</a></p> <p>AND</p> <p><a href="http://stackoverflow.com/questions/10084441/how-to-return-a-value-from-ashx-file-to-javascript-in-a-variable">http://stackoverflow.com/questions/10084441/how-to-return-a-value-from-ashx-file-to-javascript-in-a-variable</a></p> <pre class="prettyprint">context.response.write(string value); &lt;script type=&quot;text/javascript&quot;&gt; $(window).load(function(){ $('area').each(function () { var area = $(this), alt = area.attr('id'); if (alt != null) { area.mouseenter(function () { $('#dhtmltooltip').load(&quot;Search_CS.ashx?q=&quot; &#43;alt); ddrivetip('', 300); }).mouseleave(function () { $('#dhtmltooltip').html(''); hideddrivetip(); }); } });</pre> <p><br> <br> </p> <p></p> 2012-05-01T16:41:23-04:004960292http://forums.asp.net/p/1798914/4960292.aspx/1?Re+how+can+i+access+ashx+return+value+in+javascript+Re: how can i access .ashx return value in javascript? <p>And This is the Method</p> <pre class="prettyprint">function createXMLHttpRequest() { try { return new XMLHttpRequest(); } catch(e) {} try { return new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;); } catch (e) {} try { return new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;); } catch (e) {} alert(&quot;XMLHttpRequest not supported&quot;); return null; } var xmlHttpReq= createXMLHttpRequest(); xmlHttpReq.open(&quot;GET&quot;, &quot;your.ashx?v1=1&amp;v2=2&amp;etc&quot;, false); xmlHttpReq.send(null); var yourJSString = xmlHttpReq.responseText;</pre> <p><br> <br> </p> 2012-05-01T16:42:55-04:004960296http://forums.asp.net/p/1798914/4960296.aspx/1?Re+how+can+i+access+ashx+return+value+in+javascript+Re: how can i access .ashx return value in javascript? <p>I don't believe this works in IE, but it worked for me in firefox/chrome...</p> <p></p> <pre class="prettyprint">var xhr = new XMLHttpRequest(); xhr.open(&quot;POST&quot;, &quot;HandlerUploadFile.ashx&quot;, true); //set appropriate headers xhr.overrideMimeType('text/plain; charset=x-user-defined-binary'); xhr.setRequestHeader(&quot;Content-Type&quot;, &quot;multipart/form-data&quot;); xhr.setRequestHeader(&quot;X-File-Name&quot;, file.name); xhr.setRequestHeader(&quot;X-File-Length&quot;, file.fileSize); xhr.setRequestHeader(&quot;X-File-Type&quot;, file.type); xhr.send(file); self.close(); //--------- xhr.addEventListener(&quot;load&quot;, function () { //do stuff }, false);</pre> <p><br> <br> </p> 2012-05-01T16:47:03-04:004960301http://forums.asp.net/p/1798914/4960301.aspx/1?Re+how+can+i+access+ashx+return+value+in+javascript+Re: how can i access .ashx return value in javascript? <h3 id="sites-page-title-header" align="left"><span id="sites-page-title" dir="ltr">Using jQuery in ASP.NET apps with httphandlers (ASHX)</span></h3> <p><span dir="ltr"><a href="https://sites.google.com/site/spyderhoodcommunity/tech-stuff/usingjqueryinaspnetappswithhttphandlersashx">https://sites.google.com/site/spyderhoodcommunity/tech-stuff/usingjqueryinaspnetappswithhttphandlersashx</a></span></p> 2012-05-01T16:49:01-04:00