关于“react.js怎么实现刷新当前页面”这个问题,我认为:
window.open之后,子页面关闭之前刷新子页面,目前测试过的刷新方法:
1.1 window.opener.location.reload(); 该方式使用时会提示你是否确定刷新,比较烦人。
1.2 window.opener.location.href=window.opener.location.href; 该方
1原文链接:http://caibaojian.com/javascript-refresh-page.htmlreload 方法,该方法强迫浏览器刷新当前页面。·
2 语法:location.reload([bForceGet]) 参数: bForceGet, 可选参数, 默认为 false,从客户端缓存里取当前页。true, 则以 GET 方式,从服务端取最新的页面, 相当于客户端点击 F5("刷新。
3 replace 方法,该方法通过指定URL替换当前缓存在历史里(客户端)的项目,因此当使用replace方法之后,你不能通过“前进”和“后退”来访问已经被替换的U。
4 在实际应用的时候,重新刷新页面的时候,我们通常使用: location.reload() 或者是 history.go(0) 来做。因为这种做法就像是客户端点F5刷新页面,所以页面的method="post"的时候,会出现"网页过期"的提示。那是因为Session的安全保护机制。
{"moduleinfo":{"card_count":[{"count_phone":1,"count":1}],"search_count":[{"count_phone":2,"count":2}]},"card":[{"des":"打造能感知、可交互、会思考、自进化的“智能公厕”,实现对公厕环境、资源、设施、安保的智能治理,提高公厕建设质量,健全公厕管理体制,提升厕所文明水平,让市民“方便”更方便。","link1":"https://www.aliyun.com/solution/iot/toilets","link":"https://www.aliyun.com/solution/iot/toilets","icon":"https://img.alicdn.com/tfs/TB1V1raevb2gK0jSZK9XXaEgFXa-200-200.png","btn2":"立即咨询","tip":"更多优质解决方案 立即查看 立即咨询","btn1":"方案详情","link2":"https://page.aliyun.com/form/act1400415011/index.htm","title":"智慧厕所解决方案"}],"search":[{"txt":"智慧厕所","link":"https://www.aliyun.com/solution/iot/toilets"},{"txt":"智慧厕所解决方案","link":"https://www.aliyun.com/solution/iot/toilets"}],"countinfo":{"search":{"length_pc":0,"length":0},"card":{"length_pc":0,"length":0}}}
{"$env":{"JSON":{}},"$page":{"env":"production"},"$context":{"moduleinfo":{"card_count":[{"count_phone":1,"count":1}],"search_count":[{"count_phone":2,"count":2}]},"card":[{"des":"打造能感知、可交互、会思考、自进化的“智能公厕”,实现对公厕环境、资源、设施、安保的智能治理,提高公厕建设质量,健全公厕管理体制,提升厕所文明水平,让市民“方便”更方便。","link1":"https://www.aliyun.com/solution/iot/toilets","link":"https://www.aliyun.com/solution/iot/toilets","icon":"https://img.alicdn.com/tfs/TB1V1raevb2gK0jSZK9XXaEgFXa-200-200.png","btn2":"立即咨询","tip":"更多优质解决方案 立即查看 立即咨询","btn1":"方案详情","link2":"https://page.aliyun.com/form/act1400415011/index.htm","title":"智慧厕所解决方案"}],"search":[{"txt":"智慧厕所","link":"https://www.aliyun.com/solution/iot/toilets"},{"txt":"智慧厕所解决方案","link":"https://www.aliyun.com/solution/iot/toilets"}],"countinfo":{"search":{"length_pc":0,"length":0},"card":{"length_pc":0,"length":0}}}}
{"moduleinfo":{"card_count":[{"count_phone":1,"count":1}],"search_count":[{"count_phone":4,"count":4}]},"card":[{"des":"阿里技术人对外发布原创技术内容的最大平台;社区覆盖了云计算、大数据、人工智能、IoT、云原生、数据库、微服务、安全、开发与运维9大技术领域。","link1":"https://developer.aliyun.com/group/?spm=a2c6h.12883283.1377930.25.7287201c9RKTCi&groupType=other","link":"https://developer.aliyun.com/","icon":"https://img.alicdn.com/tfs/TB1TlXBEkT2gK0jSZPcXXcKkpXa-200-200.png","btn2":"开发者藏经阁","tip":"打通开发者成长路径,学习中心 。全线阿里云技术大牛公开课,立即查看","btn1":"技术与产品技术圈","link2":"https://developer.aliyun.com/topic/ebook?spm=a2c6h.12883283.1362932.15.7287201c9RKTCi","title":"阿里云开发者社区"}],"search":[{"txt":"学习中心","link":"https://developer.aliyun.com/learning?spm=a2c6h.13788135.1364563.41.299f5f24exe3IS"},{"txt":"技能测试中心 ","link":"https://developer.aliyun.com/exam?spm=a2c6h.13716002.1364563.42.6cac18a3JWCM5U"},{"txt":"开发者云 ","link":"https://developer.aliyun.com/adc/?spm=a2c6h.13716002.1364563.59.6b0818a3DV0vzN"},{"txt":"在线编程 ","link":"https://developer.aliyun.com/coding?spm=5176.13257455.1364563.57.701e7facHvqi5r"},{"txt":"学习中心 ","link":"https://developer.aliyun.com/learning?spm=a2c6h.12883283.1364563.41.5f1f201c5CLDCC"},{"txt":"高校计划 ","link":"https://developer.aliyun.com/adc/college/?spm=a2c6h.13716002.1364563.58.6cac18a3JWCM5U"}],"countinfo":{"search":{"length_pc":0,"length":0},"card":{"length_pc":0,"length":0}}}
{"$env":{"JSON":{}},"$page":{"env":"production"},"$context":{"moduleinfo":{"card_count":[{"count_phone":1,"count":1}],"search_count":[{"count_phone":4,"count":4}]},"card":[{"des":"阿里技术人对外发布原创技术内容的最大平台;社区覆盖了云计算、大数据、人工智能、IoT、云原生、数据库、微服务、安全、开发与运维9大技术领域。","link1":"https://developer.aliyun.com/group/?spm=a2c6h.12883283.1377930.25.7287201c9RKTCi&groupType=other","link":"https://developer.aliyun.com/","icon":"https://img.alicdn.com/tfs/TB1TlXBEkT2gK0jSZPcXXcKkpXa-200-200.png","btn2":"开发者藏经阁","tip":"打通开发者成长路径,学习中心 。全线阿里云技术大牛公开课,立即查看","btn1":"技术与产品技术圈","link2":"https://developer.aliyun.com/topic/ebook?spm=a2c6h.12883283.1362932.15.7287201c9RKTCi","title":"阿里云开发者社区"}],"search":[{"txt":"学习中心","link":"https://developer.aliyun.com/learning?spm=a2c6h.13788135.1364563.41.299f5f24exe3IS"},{"txt":"技能测试中心 ","link":"https://developer.aliyun.com/exam?spm=a2c6h.13716002.1364563.42.6cac18a3JWCM5U"},{"txt":"开发者云 ","link":"https://developer.aliyun.com/adc/?spm=a2c6h.13716002.1364563.59.6b0818a3DV0vzN"},{"txt":"在线编程 ","link":"https://developer.aliyun.com/coding?spm=5176.13257455.1364563.57.701e7facHvqi5r"},{"txt":"学习中心 ","link":"https://developer.aliyun.com/learning?spm=a2c6h.12883283.1364563.41.5f1f201c5CLDCC"},{"txt":"高校计划 ","link":"https://developer.aliyun.com/adc/college/?spm=a2c6h.13716002.1364563.58.6cac18a3JWCM5U"}],"countinfo":{"search":{"length_pc":0,"length":0},"card":{"length_pc":0,"length":0}}}}
{"moduleinfo":{"card_count":[{"count_phone":1,"count":1}],"search_count":[{"count_phone":4,"count":4}]},"card":[{"des":"适用于初创型物联网企业,提供消息通信数、设备连接时长、设备数据存储。满足设备基础运行需求,轻量化接入。【体验版-消息通信数(每月)10万条;设备连接时长(每月)10万分钟;设备数据存储(每月)1G】","link1":"https://common-buy.aliyun.com/?commodityCode=iot_packagesmall_pre&request=%7B%22package_type%22:%22basic%22,%22purchase_num%22:1,%22ord_time%22:%221:Year%22%7D","link":"https://www.aliyun.com/product/bgp_new","icon":"https://img.alicdn.com/tfs/TB1sG.lorY1gK0jSZTEXXXDQVXa-200-200.png","btn2":"轻量版","tip":"预付费支持多套餐购买,额度累加计算。 一键登录物联网平台控制台","btn1":"体验版","link2":"https://common-buy.aliyun.com/?commodityCode=iot_packagesmall_pre&request=%7B%22package_type%22:%22standard%22,%22purchase_num%22:1,%22ord_time%22:%221:Year%22%7D","title":"物联网平台小规格套餐包"}],"search":[{"txt":"物联网平台资源包-消息通信","link":"https://common-buy.aliyun.com/?spm=a2c56.13013782.1371428.1.5ec052e7KSJigZ&commodityCode=iot_resource_bag#/buy"},{"txt":"物联网平台资源包-连接时长","link":"https://common-buy.aliyun.com/?commodityCode=iot_resource_bag&request=%7B%22pack%22:%22FPT_iot_resource_bag_periodMonthlyAcc_1561098756%22,%22devconnect_spec%22:1000,%22ord_time%22:%221:Month%22%7D"},{"txt":"设备身份认证服务ID²","link":"https://common-buy.aliyun.com/?commodityCode=id2_license&request=%7B%22region%22:%22cn-shanghai%22,%22spec%22:%22small%22,%22product_name%22:%22__NEW_PRODUCT__%22,%22order_num%22:1,%22ord_time%22:%225:Year%22%7D"},{}],"countinfo":{"search":{"length_pc":0,"length":0},"card":{"length_pc":0,"length":0}},"$tmsId":"tce/2243198"}
{"optioninfo":{"dynamic":"true","static":"true"},"simplifiedDisplay":"newEdition","newCard":[{"link":"https://www.aliyun.com/product/mqc","icon":"mqc","title":"移动测试","des":"为企业客户和移动开发者提供真机测试服务的云平台,拥有大量热门机型,提供7x24全天候服务,帮助客户发现App中的各类隐患(应用崩溃、各类兼容性问题、功能性问题、性能问题等),减少用户流失,提高App质量和市场竞争力。","btn1":"产品详情","link1":"https://www.aliyun.com/product/mqc","btn2":"专家测试服务","link2":"https://www.aliyun.com/service/mobiletesting","btn3":"最新活动","link3":"https://www.aliyun.com/activity/emas/emas_promotion","infoGroup":[{"infoName":"产品文档","infoContent":{"firstContentName":"什么是移动测试","firstContentLink":"https://help.aliyun.com/document_detail/93530.html","lastContentLink":"https://help.aliyun.com/knowledge_detail/57132.html","lastContentName":"功能特性"}},{"infoName":"用户指南","infoContent":{"firstContentName":"Android测试","firstContentLink":"https://help.aliyun.com/document_detail/169881.html","lastContentName":"iOS测试","lastContentLink":"https://help.aliyun.com/document_detail/112018.html"}},{"infoName":"常见问题","infoContent":{"firstContentName":"产品相关问题","firstContentLink":"https://help.aliyun.com/document_detail/171153.html","lastContentName":"技术相关问题","lastContentLink":"https://help.aliyun.com/document_detail/171156.html"}},{"infoName":"技术支持","infoContent":{"firstContentName":"钉钉官方答疑群","firstContentLink":"https://help.aliyun.com/document_detail/67284.html"}}]}],"card":[],"search":[],"infoCard":[],"title":{"mainTitle":"","subtitle":"","linkUrl":"","btnText":""},"visual":{"topbg":"https://img.alicdn.com/tfs/TB1EJ1xJkL0gK0jSZFxXXXWHVXa-1740-328.jpg","icon":"dbl-icon-product-mqc","textColor":"light"},"dataList":[],"sceneCard":[],"txt":[{"title":"适用场景","scenariosone":[]}]}
{"$env":{"JSON":{}},"$page":{"env":"production"},"$context":{"optioninfo":{"dynamic":"true","static":"true"},"simplifiedDisplay":"newEdition","newCard":[{"link":"https://www.aliyun.com/product/mqc","icon":"mqc","title":"移动测试","des":"为企业客户和移动开发者提供真机测试服务的云平台,拥有大量热门机型,提供7x24全天候服务,帮助客户发现App中的各类隐患(应用崩溃、各类兼容性问题、功能性问题、性能问题等),减少用户流失,提高App质量和市场竞争力。","btn1":"产品详情","link1":"https://www.aliyun.com/product/mqc","btn2":"专家测试服务","link2":"https://www.aliyun.com/service/mobiletesting","btn3":"最新活动","link3":"https://www.aliyun.com/activity/emas/emas_promotion","infoGroup":[{"infoName":"产品文档","infoContent":{"firstContentName":"什么是移动测试","firstContentLink":"https://help.aliyun.com/document_detail/93530.html","lastContentLink":"https://help.aliyun.com/knowledge_detail/57132.html","lastContentName":"功能特性"}},{"infoName":"用户指南","infoContent":{"firstContentName":"Android测试","firstContentLink":"https://help.aliyun.com/document_detail/169881.html","lastContentName":"iOS测试","lastContentLink":"https://help.aliyun.com/document_detail/112018.html"}},{"infoName":"常见问题","infoContent":{"firstContentName":"产品相关问题","firstContentLink":"https://help.aliyun.com/document_detail/171153.html","lastContentName":"技术相关问题","lastContentLink":"https://help.aliyun.com/document_detail/171156.html"}},{"infoName":"技术支持","infoContent":{"firstContentName":"钉钉官方答疑群","firstContentLink":"https://help.aliyun.com/document_detail/67284.html"}}]}],"card":[],"search":[],"infoCard":[],"title":{"mainTitle":"","subtitle":"","linkUrl":"","btnText":""},"visual":{"topbg":"https://img.alicdn.com/tfs/TB1EJ1xJkL0gK0jSZFxXXXWHVXa-1740-328.jpg","icon":"dbl-icon-product-mqc","textColor":"light"},"dataList":[],"sceneCard":[],"txt":[{"title":"适用场景","scenariosone":[]}]}}
移动测试
为企业客户和移动开发者提供真机测试服务的云平台,拥有大量热门机型,提供7x24全天候服务,帮助客户发现App中的各类隐患(应用崩溃、各类兼容性问题、功能性问题、性能问题等),减少用户流失,提高App质量和市场竞争力。
{"moduleinfo":{"card_count":[{"count_phone":1,"count":1}],"search_count":[{"count_phone":3,"count":3}]},"card":[{"des":"IP地理位置库(GeoIP Databases)是对运营商分配的IP地址进行地理定位的服务,鉴别出IP地址被分配使用的大致地理位置范围(精确到市区级)。","link1":"https://www.aliyun.com/product/dns/geoip","link":"https://www.aliyun.com/product/dns/geoip","icon":"https://img.alicdn.com/tfs/TB12mAkJUz1gK0jSZLeXXb9kVXa-200-200.png","btn2":"前往控制台","tip":"","btn1":"查看详情","link2":"https://dns.console.aliyun.com/#/ipPositions/list","title":"IP地理位置库"}],"search":[{"txt":"DNS全系列产品集","link":"https://www.aliyun.com/product/dns"},{"txt":"云解析DNS(公网域名解析)","link":"https://wanwang.aliyun.com/domain/dns"},{"txt":"PrivateZone","link":"https://www.aliyun.com/product/pvtz"}],"countinfo":{"search":{"length_pc":0,"length":0},"card":{"length_pc":0,"length":0}},"simplifiedDisplay":"newEdition","newCard":[{"ifIcon":"img","icon":"gtm","link":"https://www.aliyun.com/product/dns/geoip","contentLink":"https://www.aliyun.com/product/dns/geoip","infoGroup":[{"infoName":"产品入门","infoContent":{"firstContentName":"产品定价","lastContentName":"开发指南","firstContentLink":"https://help.aliyun.com/document_detail/154117.html","lastContentLink":"https://help.aliyun.com/document_detail/154143.html"}},{"infoName":"关联产品","infoContent":{"firstContentName":"云解析DNS","firstContentLink":"https://wanwang.aliyun.com/domain/dns","lastContentName":"PrivateZone","lastContentLink":"https://www.aliyun.com/product/pvtz"}}],"btn1":"查看详情","link1":"https://www.aliyun.com/product/dns/geoip","title":"IP地理位置库","iconImg":"https://img.alicdn.com/tfs/TB12mAkJUz1gK0jSZLeXXb9kVXa-200-200.png","btn2":"前往控制台","btn3":"帮助手册","des":"IP地理位置库(GeoIP Databases)是对运营商分配的IP地址进行地理定位的服务,鉴别出IP地址被分配使用的大致地理位置范围(精确到市区级)。","link2":"https://dns.console.aliyun.com/#/ipPositions/list","link3":"https://help.aliyun.com/product/151537.html"}],"visual":{"icon":""}}
{"$env":{"JSON":{}},"$page":{"env":"production"},"$context":{"moduleinfo":{"card_count":[{"count_phone":1,"count":1}],"search_count":[{"count_phone":3,"count":3}]},"card":[{"des":"IP地理位置库(GeoIP Databases)是对运营商分配的IP地址进行地理定位的服务,鉴别出IP地址被分配使用的大致地理位置范围(精确到市区级)。","link1":"https://www.aliyun.com/product/dns/geoip","link":"https://www.aliyun.com/product/dns/geoip","icon":"https://img.alicdn.com/tfs/TB12mAkJUz1gK0jSZLeXXb9kVXa-200-200.png","btn2":"前往控制台","tip":"","btn1":"查看详情","link2":"https://dns.console.aliyun.com/#/ipPositions/list","title":"IP地理位置库"}],"search":[{"txt":"DNS全系列产品集","link":"https://www.aliyun.com/product/dns"},{"txt":"云解析DNS(公网域名解析)","link":"https://wanwang.aliyun.com/domain/dns"},{"txt":"PrivateZone","link":"https://www.aliyun.com/product/pvtz"}],"countinfo":{"search":{"length_pc":0,"length":0},"card":{"length_pc":0,"length":0}},"simplifiedDisplay":"newEdition","newCard":[{"ifIcon":"img","icon":"gtm","link":"https://www.aliyun.com/product/dns/geoip","contentLink":"https://www.aliyun.com/product/dns/geoip","infoGroup":[{"infoName":"产品入门","infoContent":{"firstContentName":"产品定价","lastContentName":"开发指南","firstContentLink":"https://help.aliyun.com/document_detail/154117.html","lastContentLink":"https://help.aliyun.com/document_detail/154143.html"}},{"infoName":"关联产品","infoContent":{"firstContentName":"云解析DNS","firstContentLink":"https://wanwang.aliyun.com/domain/dns","lastContentName":"PrivateZone","lastContentLink":"https://www.aliyun.com/product/pvtz"}}],"btn1":"查看详情","link1":"https://www.aliyun.com/product/dns/geoip","title":"IP地理位置库","iconImg":"https://img.alicdn.com/tfs/TB12mAkJUz1gK0jSZLeXXb9kVXa-200-200.png","btn2":"前往控制台","btn3":"帮助手册","des":"IP地理位置库(GeoIP Databases)是对运营商分配的IP地址进行地理定位的服务,鉴别出IP地址被分配使用的大致地理位置范围(精确到市区级)。","link2":"https://dns.console.aliyun.com/#/ipPositions/list","link3":"https://help.aliyun.com/product/151537.html"}],"visual":{"icon":""}}}