jQuery(document).ready(function() {
jQuery('.bnr').each(function() {
var group = jQuery(this).attr('adgroup');
var obj = jQuery(this);
jQuery.get("http://www.example.com/ads.php",
{ 'adGroup': group },
function( response ) {
obj.html( response );
}
);
})
});
I'm trying to load ads using jQuery. The ads.php return affiliates code. Problem is when the return response is javascript. All works only if response is html. Using eval() do not work or i'm missing something. response example:
<script type="text/javascript" src="http://adserving.unibet.com/ad.aspx?pid=1234&pbg=123">