开发者

help conversion code in prototype to jquery

开发者 https://www.devze.com 2023-01-17 12:24 出处:网络
Good day, I\'m done with the following code into prototype var DataAjax = new Ajax.Updater(\'Data\',\'/inc/infoPanel.asp\', {method:\'get\', parameters:\'Name=\'+appIdOrName});

Good day, I'm done with the following code into prototype

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

I wonder how would this code in jquery, I'm trying here but I can not.

I thank anyone who can help.

thanks!


You're looking for the jQuery's load() method...

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

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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号