Get MSN ADS

前几天写的获取MSN IM 广告,经过使用有点问题,就是在IE7下,默认的安全设置下,xmlHttpRequest是有跨域问题的。

而且感觉没必要那么麻烦。

完全可以使用iframe的方式。

优点:

1. 简洁

2. 解决了跨域问题

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 
<head>
  
<title> ads </title>
  
<meta name="generator" content="editplus" />
  
<meta name="author" content="Stefanie" />
  
<meta name="keywords" content="MSN,ADS" />
  
<meta name="description" content="获取并重新渲染msn广告" />
 
</head>

 
<body style="margin-left:-10px;margin-top:-14px;">
  
<iframe src="http://rad.msn.com/ADSAdClient31.dll?GetAd=&PG=IMSCH2" scrolling="no" frameborder="0" ></iframe>
 
</body>
</html>

不过MSN广告留白的区域有时候不固定,还不明确是广告flash大小问题,还是别的问题。客户端这边无法精确的控制其渲染位置。

 

原文地址:https://www.cnblogs.com/wpsl5168/p/1438424.html