帮助将原型中的转换代码转换为jquery

时间:2010-09-21 14:11:13

标签: jquery prototypejs

美好的一天,我完成了以下代码到原型

var DataAjax = new Ajax.Updater('Data','/inc/infoPanel.asp', {method:'get', parameters:'Name='+appIdOrName});
        DataAjax.onComplete = function(){
        if ($('Data').innerHTML.indexOf('status=ok')>-1){
            loadBlogsphere(IdOrName);
        }

我想知道jquery中的代码怎么样,我在这里尝试,但我不能。

我感谢任何可以提供帮助的人。

谢谢!

1 个答案:

答案 0 :(得分:0)

您正在寻找jQuery的load()方法......

.load() - Description: Load data from the server and place the returned HTML into the matched element.(来自jQuery文档)

$('#Data').load('/inc/infoPanel.asp', { Name : appIdOrName }, function(responseData)
{
    // Not sure about this part...
    if (responseData.indexOf('status=ok') > -1)
    {
        loadBlogsphere(IdOrName);
    }
});