js call

先声明对象a,
function a(){}
向a的原型添加属性和方法
a.prototype={
ss:'xx',
name:function(){console.log(this.ss)}
};
实例化对象a
var na=new a
这时又有一个对象b
b={ss:'00'}
我们想让它借助a的name方法,于是便有了
na.name.call(b)

console.log(b.name)

========================================================
附一个来自知乎的例子:
var Parent = function(){ this.name = "yjc"; this.age = 22; } var child = {}; console.log(child);//Object {} ,空对象 Parent.call(child); console.log(child); //Object {name: "yjc", age: 22}


from:余建材 https://www.zhihu.com/question/20289071/answer/80892838

 


<template id="login_navbar" inherit_id="website.layout" name="Login Page Navigation"> <xpath expr="//header" position="before"> <nav class="custom-login-nav" style="background:#000;border-bottom:1px solid #eee;padding:10px 0;position:fixed;top:0;left:0;width:100%;z-index:1099;"> <div style="margin:0 auto;display:flex;align-items:center;justify-content:space-between;padding:0 15px;"> <div> <small> <span style="font-weight:bold;font-size:15px;color:#7c6e7f;text-decoration:none;"> 欢迎访问Odoo亚太地区金牌服务机构·开源智造(OSCG)</span> <span style="" class="text-white"> <b>&nbsp;</b> </span> </small> <a href="tel:400-900-4680" data-original-title="" title="" aria-describedby="tooltip383200"> <small> <b data-original-title="" title="" aria-describedby="tooltip932940"> <i class="fa fa-1x fa-fw fa-phone ml-3 mr-2 text-white" style="" data-original-title="" title="" aria-describedby="tooltip873223" /> <font style="font-size: 12px;color:#fff;">400-900-4680&nbsp;</font> </b> </small> </a> <a href="mailto:sales@oscg.cn" data-original-title="" title="" aria-describedby="tooltip722417"> <small> <i class="fa fa-1x fa-envelope fa-fw ml-3 mr-2 text-o-color-3" style="font-size: 12px;" data-original-title="" title="" aria-describedby="tooltip553776" /> <font style="" class="text-o-color-4" data-original-title="" title="" aria-describedby="tooltip42618"><b>sales@oscg.cn</b>&nbsp;</font> </small> </a> </div> <div style="color:#fff;"> <div class="no_icon_color s_share" data-name="Social Media"> <small class="s_share_title text-muted"> <span style="font-size: 14px;" class="text-o-color-4"> <b>Language/语言</b> </span> <span style="font-size: 14px;"> <b>:</b> </span> <span style="font-size: 11.2px;"> <b> </b> </span> </small> <img src="/website_login_nav/static/src/img/cn.png" style="width:20px;height:14px;vertical-align:middle;margin-right:5px;" /> &nbsp;<font style="font-size: 12px;"> <b><a href="http://www.oscg.cn/" data-original-title="" title="" style="color:#fff;"> 简体中文&nbsp;</a> &nbsp; &nbsp;&nbsp;</b> </font> <img src="/website_login_nav/static/src/img/us.png" style="width:20px;height:14px;vertical-align:middle;margin-right:5px;" /> &nbsp;<span style="display: inline !important; font-size: 12px;"> <b><a href="http://www.oscg.com.hk" data-original-title="" title="" style="color:#fff;" aria-describedby="tooltip75929">English</a>&nbsp; &nbsp; &nbsp;&nbsp;</b> </span> <!-- <img src="/website_login_nav/static/src/img/jp.png" style="width:20px;height:14px;vertical-align:middle;margin-right:5px;" /> &nbsp;<span style="display: inline !important; font-size: 12px;"> <b><a href="http://www.oscg.com.hk" data-original-title="" title="" style="color:#fff;" aria-describedby="tooltip75929">日本語</a>&nbsp; &nbsp; &nbsp;&nbsp;</b> </span> --> <span style="font-size: 0.875rem; display: inline !important;">&nbsp;</span> </div> </div> </div> </nav> </xpath> <!-- 为wrapwrap添加上边距 --> <xpath expr="//div[@id='wrapwrap']" position="attributes"> <attribute name="style">padding-top: 110px;</attribute> </xpath> </template>可以实现在header顶部,但是手机端的会把header遮挡住,应该如何修改才可以变为odoo的定制模块‘
最新发布
08-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值