javascript 加入html
<script type="text/template" id="html_template">
<a href="mqqwpa://im/chat?chat_type=wpa&uin=3582739657&version=1&src_type=web&web_src=yashangzhengzheng.com" target="_blank" title="在线咨询">
<img alt="" src="theme/bg/bg04.jpg" /></a>
</script>
<script type="text/javascript">
var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
//alert('是否是Android:' + isAndroid);
if (isAndroid) { document.write(document.getElementById('html_template').innerHTML); }
if (isiOS) { document.write(document.getElementById('html_ios').innerHTML); }
//alert('是否是iOS:' + isiOS);
</script>