gpt4 book ai didi

javascript - 在不知道完整网址的情况下获取一部分网址

转载 作者:行者123 更新时间:2023-12-03 01:59:59 25 4
gpt4 key购买 nike

即时通讯使用角度4,我使用此代码:

this.location.prepareExternalUrl(this.location.path()) === '/cursos/aula'


用于在3页中删除导航栏,但在一页中,我在url中有参数,并且此代码不起作用。我如何捕获网址以删除网址中包含参数的导航栏?
例如:

this.location.prepareExternalUrl(this.location.path()) === '/cursos/aula?idCurso=3'


要么

this.location.prepareExternalUrl(this.location.path()) === '/cursos/aula?idCurso=7'

最佳答案

您可以尝试使用.includes()

关于javascript - 在不知道完整网址的情况下获取一部分网址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50080706/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com