2012-04-10 3 views
1

자바 스크립트에서 ashx 파일을 호출합니다. HTTP 처리기 파일이 문자열 값을 반환합니다.변수에서 자바 스크립트로 .ashx 파일의 값을 반환하는 방법

context.response.write(string value); 


<script type="text/javascript"> 
$(window).load(function(){ 

$('area').each(function() {  
    var area = $(this), 

alt = area.attr('id'); 
if (alt != null) { 

       area.mouseenter(function() { 
        $('#dhtmltooltip').load("Search_CS.ashx?q=" +alt); 
        ddrivetip('', 300); 
       }).mouseleave(function() { 
        $('#dhtmltooltip').html(''); 
        hideddrivetip(); 
       }); 
      } 

     }); 

자바 스크립트에서이 문자열을 수신해야합니다.

어떻게 수행 할 수 있습니까?

+0

HttpHandler를 제어합니까? 어떤 콘텐츠 유형이 설정/반환됩니까? –

답변

0

아약스 요청을하지 않으셔도됩니다. 이 page이 도움이됩니까? "insertCustomerCallback"이라는 함수 호출이 있는데 핸들러에서 html이 반환됩니다. 거기에 코드를 작성해야합니다. 예 :

function insertCustomerCallback(html) { 
//write your code 
}