Is there an existing tool for jsonp like fetching of xml in jquery?

后端 未结 3 1052
灰色年华
灰色年华 2021-01-02 13:55

For a web service I\'m developing I would like my embedded code (on the client\'s site) to fetch an xml file from my sever script which resides on my domain.

As this

3条回答
  •  余生分开走
    2021-01-02 14:38

    As of jQuery 1.5 there is a utility method, it's saved my life for using jsonp to load in XML.

    var xml = "RSS Title",
    xmlDoc = $.parseXML( xml ),
    $xml = $( xmlDoc ),
    $title = $xml.find( "title" );
    

    http://api.jquery.com/jQuery.parseXML/

提交回复
热议问题