jQuery load not woking when embeding a JavaScript based Poll to my website

420 Views Asked by At

Both surveymonkey and polldaddy give you an script to embed in you web site. Ex:

<script type="text/javascript" charset="utf-8"
src="http://static.polldaddy.com/p/POLLID.js"></script><noscript><a
href="http://polldaddy.com/poll/POLLID/">Question?</a></noscript>

The problem is that if I load the fragment using jquery load the poll wont show.

Within the head of my website I got the following script and an empty div with the id="fragment-sidebar-poll"

<script type="text/javascript">
$(document).ready(function() {
    $('#fragment-sidebar-poll').load('/fragments/sidebar-poll');
}
</script>

On firebug I see that the jquery load returns the code given from polldaddy. But the poll does not appear and on Firebug console I see the error _container is null.

Note: with surveymonkey I do not see an error but the survey wont show either.

1

There are 1 best solutions below

0
On

Close your ready() function, you are missing );

<script type="text/javascript">
    $(document).ready(function() {
        $('#fragment-sidebar-poll').load('/fragments/sidebar-poll');
    });
</script>