脚本加载脚本广告
script load script ads
我有代码html-js-css作为
$('.list li:nth-child(4)').after('<li class="new-elem"></li>');
li.new-elem {width:336px; height:280px; background:#faa}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<article class="list">
<li>Thi is list post 01</li>
<li>Thi is list post 01</li>
<li>Thi is list post 01</li>
<li>Thi is list post 01</li>
<li>Thi is list post 01</li>
</article>
现在如何插入脚本
<script type="text/javascript">document.write("<iframe src='http://www.myadscode.com/ads/banneriframe.php?pchsh=xxxxxxxxxxxxxxxxxxx&t=336x280&cb=" + (Math.floor(Math.random()*99999) + new Date().getTime()) + "' style='width:336px;height:280px;' frameborder='0' scrolling='no'></iframe>");</script>
作为:
$('.list li:nth-child(4)').after('<li class="new-elem"><script type="text/javascript">document.write("<iframe src='http://www.myadscode.com/ads/banneriframe.php?pchsh=xxxxxxxxxxxxxxxxxxx&t=336x280&cb=" + (Math.floor(Math.random()*99999) + new Date().getTime()) + "' style='width:336px;height:280px;' frameborder='0' scrolling='no'></iframe>");</script></li>');
这是错误代码
感谢
$(function() {
var l = $('.list li').length-1;
$('.list li').eq(l).after('<li class="new-elem">My script ads here</li>');
});
<!-- ========= Or ======= -->
$(function() {
$('.list li').eq('4').after('<li class="new-elem">My script ads here</li>');
});
使用此
$('.list li').eq('4').after('<li class="new-elem">My script ads here</li>');
添加类似于此的url
$('.list li').eq('4').after("<li class="new-elem"><iframe src='http://www.myadscode.com/ads/banneriframe.php?pchsh=xxxxxxxxxxxxxxxxxxx&t=336x280&cb=" + (Math.floor(Math.random()*99999) + new Date().getTime()) + "' style='width:336px;height:280px;' frameborder='0' scrolling='no'></iframe></li>");
代替
$('.list li:nth-child(4)').after('<li class="new-elem">My script ads here</li>');
相关文章:
- Joomla异步脚本加载jdoc头
- 将自定义脚本加载到Vue.js组件中
- 延迟加载 脚本加载和/或执行
- 脚本加载问题
- I'当我试图将java脚本加载到web视图中时,我得到了一个空白屏幕
- 脚本加载脚本广告
- 当我有一个脚本数组时,如何等待脚本加载
- 将Dropbox API脚本加载到chrome扩展时出错
- 异步脚本加载
- 一旦第三方脚本加载失败,立即运行一段JavaScript
- 有没有办法阻止脚本加载两次?JavaScript
- 无法使用 AJAX 将脚本加载为纯文本
- 我怎样才能说服WebStorm我的用户脚本加载jQuery
- 需要JS脚本加载顺序
- 处理不同设备的页面中的脚本加载
- 显示加载 gif,直到脚本加载完毕
- jQuery Mobile pageinit,脚本加载和其他东西
- IE11 脚本加载不起作用(有时)
- 有条件地将内容脚本加载到 Safari 扩展中,就像在 FF/Chrome 中一样
- 如何在Chrome开发工具中找到以下脚本加载时间线