We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5340
    • 1,624 Posts
    Hi,

    I am looking for a solution that will allow me to read data(with jquery/ajax) from another page.
    The code is on a subdomain: sub.site.abc/page1.html
    The page I want to read is at site.abc/page2.html

    Right now the code below doesn’t work because the request does not come from the same subdomain. Is there a solution to this problem.
    A php solution would work. Maybe some one can point me in the right direction(probably a php html parser)

    <script type="text/javascript">
    $(document).ready(function () {
    
    	$("#ProgramAvailability").load("http://www.site.abc/content/availability div.content", function(response, status, xhr) {
    		if (status == "error") {
    			var msg = "Sorry but there was an error: ";
    			$("#ProgramAvailability").html(msg + xhr.status + " " + xhr.statusText);
    		}
    	});
    
    });
    
    </script>
    
    <div id="ProgramAvailability"></div>



    Thank you