ajax - XML file content display on HTML page -
i have xml url , want display content url html page. here code trying make happend.
<head> <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> <script type="text/javascript"> $(document).ready(function () { // load xml file using jquery ajax $.ajax({ type: "get", url: "http://courseleaf.ua.edu/introduction/academicpolicies/departmentprogramcoursealphasymbols/index.xml", datatype: "xml", success: function (req) { if($(req).find("text").length) { var course = $(req).find("text").text(); } else { var course = "<p>course information cannot found. </p>"; } $('#result').html(course); } }); }); </script> </head> <body> <div id="result"></div> </body>
getting error: sec7118: xmlhttprequest http://courseleaf.ua.edu/introduction/academicpolicies/departmentprogramcoursealphasymbols/index.xml required cross origin resource sharing (cors). catalog
i tried figure out problem no luck. can me solve issue.
thanks.
Comments
Post a Comment