The simple question: How do I run a remote aspx webservice dynamically from Javascript?
Background Info:
There is a 3rd party remote aspx webservice that I normally run with no problems from a Wordpress webpage by simply putting it in like this:
<script type=’’ src=’http://boo.foo.com/Remote-Frame.aspx'></script>
FYI… this aspx actually inserts an iframe into my page at this location within the page which provides the user with a MLS Search Tool.
This works just great, but this script, of course, loads/runs at page load time and I don’t want that anymore.
What I want to do:
I want to "run it" when, for example, a user clicks on a button.
Here is a snippet of what I have thus far, but the webservice doesn't actually run.
<div id=’homesearch’></div>
<script type='text/javascript'>
var ss = document.createElement('script');
ss.type = '';
ss.async = false;
ss.src = ’http://boo.foo.com/Remote-Frame.aspx';
var dd = document.getElementById('homesearch');
dd.parentNode.insertBefore(ss, dd);
But now how do I tell it to "run"?
</script>
The solution?
What am I missing or maybe there is a simpler solution. And keep in mind that the solution must work in all major browsers. Thank you in advance.