js前端学习笔记


//加购物车
$(".button-hwep-add-cart").each(function(){
var categoryid = $(this).attr("data-categoryid");
var sku=$(this).attr("data-sku");
var skuCode=$(this).attr("data-skucode");
var id = $(this).attr("id");
var name=$(this).parent().parent().find(".p-name>a").text();
$(this).before('<a class="button-hwep-add-cart" href=" " data-categoryid="' + categoryid
+ '"data-sku="' + sku + '"id="' + id + '" onclick="ec.product.addCart(' +sku + ',\'' + name + '\',8, 1,this , \'' + skuCode + '\');return false;">加入购sdfsf物车</ a>');
$(this).remove();
});

// <p class="p-name">
// <a title="手表 ES 陨石黑" href="https://www.xxxxxxxx.com/cn/shop/product/10086969343857.html?source=inner#10086044266211" target="_blank">手表 ES 陨石黑</a>
// </p>

ec.product.addCart(data-sku,'',8, 1,this , data-skucode)
ec.product.addCart(10086044266211,'',8, 1,this , '2901010129204')

// 立即结算
$(".sc-total-btn").childNodes[0].click()
// 提交订单
ec.order.submit()


// 点击事件
document.evaluate("/html/body/div[2]/div[1]/div[5]/div/div/div[3]/div/a[2]/span",document).iterateNext().click()

// 页面追加
document.body.append(Date())
document.body.prepend("     兄弟加油" + Date())


//页眉的插入
var frameDiv = document.createElement("p");
frameDiv.setAttribute("style", "background-color:Aquamarine");
var TX=document.createTextNode("兄弟加油" + Date())
frameDiv.appendChild(TX)
document.body.prepend(frameDiv)
// <p style="background-color:Aquamarine ">通过十六进制设置背景颜色</p>

// 页面打印
document.write("<h1>这是一个标题</h1>");

// 控制台打印
console.log("aaa")
console.dir(qwe.innerHTML)

// 跳转网页
window.open("http://www.baidu.com","_blank")
self.location.href="http://www.baidu.com"

//创建div节点
var frameDiv = document.createElement("div");
//给创建的div设置id值;
frameDiv.setAttribute("id", "divid");
//给创建的div设置class;
frameDiv.className="divclass"; 
// 添加子节点
qwe.appendChild(frameDiv);

//给子节点添加id
var qwe=$(".sc-total-btn")
qwe.childNodes[0].setAttribute("id", "divid");
qwe.setAttribute("id", "divid");

//删除子节点
var _li=document.getElementById("_li");
_li.removeChild(_li.childNodes[1]);

//查找元素
document.getElementsByClassName(".sc-total-btn")
document.getElementById("span123")

// 刷新页面
location.reload()

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值