Sunday 15 June 2014

JQuery Plugin Help -


I am trying to develop a JQuery plug-in that would access an external XML feed and display the results. Even I have so far:

Include HTML header

  & lt; Script language = "javascript" src = "jquery.rss.js" type = "text / javascript" & gt; & Lt; / Script & gt;  

JQuery Ready

  & lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ ("# rss"). RSS ({count: 6, loading_text: "loading"})}}; & lt; / script & gt;  

plugin (jquery.rss.js)

  (function ($) {$ .fn.rss = function (o) {var s = {count: 6, loading_text: Null;}; if (o) $ .exende (s, o); this return. (Function () {var list = $ ('& lt; ul class = "rss" & gt;') .appendTo (this) ; Var loading = $ ('& lt; p class = "desc"> 
IMG src = "loading.gif" height = "19" width = "18" range = "0" & ​​amp; Gt;
'+ s.loading_text +' '); var item = 0; var url =' http: // www. Example.com/feed.xml; if (S.loading_text) $ (this) .Append (loading); $ .et (url, {}, function} {if loading (sloading_text) is loading.Riv (); $ ('forecast', data) each (function (i) {var title = $ (this). Type ("title"). Text (); var description = $ (this) .find ("description"). Text (); list.append ('& lt; li & gt;' + title + '-' + Details + '& lt; / li & gt; '); Item ++; If (item == s count) last; }); }); }); }}) (JQuery);

As long as I do not try $$, everything works correctly. I've verified using the alert () that the correct url is being called from the $ $ .get request.

Hopefully I am not far away and a Jaguar guru can tell me where I am going wrong. Thanks in advance for your help!

You can not cross-domain AJAX requests or develop server-side proxies (same Posted on the host) that route your request to the Underground or look at the API that supports JSONP.

Also see -


No comments:

Post a Comment