BOM以及几个对象

JavaScript分为三个部分

  • ECMAScript:JavaScript的语法标准。包括变量、表达式、运算符、函数、if语句、for语句等。

  • DOM:文档对象模型,操作网页上的元素的API。比如让盒子移动、变色、轮播图等。

  • BOM:浏览器对象模型,操作浏览器部分功能的API。比如让浏览器自动滚动。 

BOM:Browser Object Model,浏览器对象模型。

常见的几个对象history location nabigator window

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
    <script>
        // open方法
        setTimeout(function () {
            // window对象打开窗口
            window.open('http://www.baidu.com', '_self');
        },2000);
        //location对象:相当于解析url
        setTimeout(function () {
            location.href = "http://www.baidu.com";
            window.location.reload();//重加载
        }, 5000);
        // navigator对象 可以获取客服端一些信息
        console.log(navigator.userAgent);
        console.log(navigator.platform);
    </script>
</body>
</html>

history对象
1、后退:

  history.back()

  history.go(-1):0是刷新

2、前进:

  history.forward()

  history.go(1)

  

 

转载于:https://www.cnblogs.com/Alexephor/p/11347777.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Windchill提供了几种方法来导出BOM数据,其中包括使用API导出BOM数据。以下是使用API导出BOM数据的一些步骤: 1. 使用Windchill API访问需要导出的BOM对象。 2. 使用API获取BOM对象的所有子件信息。 3. 将所有子件信息导出到Excel或CSV文件中。 以下是一个使用Windchill API导出BOM数据的Python示例代码: ```python import wt.method.MethodContext import wt.part.WTPart import wt.part.WTPartHelper import wt.part.WTPartUsageLink import wt.query.QuerySpec import wt.query.SearchCondition import wt.util.WTException def export_bom(part_number, file_path): try: # 获取WTPart对象 part = WTPartHelper.service.getByNumber(part_number) # 创建查询条件 qs = QuerySpec(WTPartUsageLink) qs.appendSearchCondition(SearchCondition.newMatch(WTPartUsageLink.WTPART_MASTER_REF, part.getMasterReference())) # 获取所有子件 usage_links = wt.query.QueryEngine.query(qs) # 导出数据到文件 with open(file_path, 'w') as file: file.write('Parent Part,Child Part,Quantity\n') for usage_link in usage_links: child_part = usage_link.getUses() quantity = usage_link.getQuantity().getValue() file.write(f'{part.getNumber()},{child_part.getNumber()},{quantity}\n') except WTException as wte: print(f'Error: {wte.getMessage()}') ``` 在此示例中,我们使用WTPartHelper服务获取WTPart对象,然后使用查询来获取所有子件。最后,我们将数据导出到一个CSV文件中。 请注意,此示例仅涵盖了基本的导出BOM数据的过程。你需要根据自己的需求进行调整和扩展。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值