开发者

Jquery: Problem passing XML to function using $.get

开发者 https://www.devze.com 2022-12-14 01:58 出处:网络
I seem to have an issue passing the xml i am reading to a function.. Basically i have this, this seems to work

I seem to have an issue passing the xml i am reading to a function.. Basically i have this, this seems to work

    $.get("content/xml/faq.xml", function(test) {
        alert(test);// TEST CONTAINS THE XML
    });

but i really want to isolate the function and have the get开发者_JS百科 call a new function but "data" in my function is undefined. I do end up in processFaq so the call back is working but data is empty

    $.get("content/xml/faq.xml", processFaq());

    function processFaq(data) {
       alert(data);  // DATA IS UNDEFINED
    }

Anybody know what i am doing wrong?

Thanks in advance


 $.get("content/xml/faq.xml", processFaq);

this should work

0

精彩评论

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