I'm new in this feild, all what开发者_如何学运维 I want is a custom wordpress widget to do ajax call that will call my asp.net page which in turns display an html table of products.
Can someone help me with this please?
Suggestion, assuming this has to be done with ajax and could not be done with plain php during the page load:
Make ajax request to a php script on the same domain. That php script interns loads the external HTML via php's curl implementation, or whatever other external scraping type methods are available.
For the ajax itself, use jQuery (bundled with WP), simple pseudo code:
<?php wp_enqueue_script('jquery'); ?>
<script>
jQuery.get('/some/path/asp.php?some=args&go=here', function(data) {
jQuery('my_div').html( data );
});
</script>
<?php
/**
* @file asp.php
*/
echo ( $html = file_get_contents('http://remotehost.com/products.asp?$args')) $html: 'no way jose';
精彩评论