1

我正在从 javascript 调用 ashx 文件。Http Handler 文件返回字符串值。

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();
                });
            }

        });

我必须在 javascript 的变量中接收这个字符串。

如何做到这一点?

4

1 回答 1

0

I guess you are not making any ajax requests. Does this page help? There is a function call named "insertCustomerCallback" which will have the html returned from the handler. There you need to write your code. For e.g.,

function insertCustomerCallback(html) {
//write your code
}
于 2012-06-12T20:22:47.797 回答