草庐IT

location-client

全部标签

javascript - Aurelia 没有这样的文件或目录 aurelia-fetch-client.js

我是Aurelia的初学者,正在学习将代码片段放在一起。itemWithPicture.jsimport"fetch";import{HttpClient,json}from"aurelia-fetch-client";lethttpClient=newHttpClient();exportclassItemWithPicture{constructor(){this.heading="ItemwithPicture";}}我得到的错误是{[Error:ENOENT:nosuchfileordirectory,open'C:\GitRepo\pictureRecord\node_mod

javascript - IE7 中的 window.location.hash 问题

我们有一个javascript函数,可以使用anchor将页面“移动”到特定位置。此函数只是执行window.location.href="#"+hashName。这适用于FF,但不适用于IE。我在WindowsXP下使用IE7测试了这段代码。我已经尝试过usingwindow.location.href、window.location.hash、window.location.replace和所有这些方法,但使用文档对象。有谁知道如何处理这个问题? 最佳答案 IE和大多数其他浏览器将使用anchor.focus()滚动到一个anc

javascript - 如何在 angularjs 测试中模拟 $location.host()?

我已经创建了一个包含环境信息的Env服务,我目前正在使用$location.host()来确定我所处的环境。我如何在我的测试中模拟它?我读过https://groups.google.com/forum/?fromgroups#!topic/angular/F0jFWC4G9hI,但它似乎不起作用,例如:describe("Env(environment)service",function(){varEnv;beforeEach(module('App'));beforeEach(inject(['Env',function(e){Env=e;}]));describe("forsta

Javascript ES6 解构 - 标识符 'location' 已被声明

我有一个简单的对象数组,想获取第一个元素的位置属性:constcompanies=[{name:'Google',location:'MountainView'},{name:'Facebook',location:'MenloPark'},{name:'Uber',location:'SanFrancisco'}];const[{location}]=companies;//expected:MountainViewbutgotUncaughtSyntaxError:Identifier//'location'hasalreadybeendeclaredat:1:1我错过了什么?

javascript - 在帧中设置 location.hash

我正在使用ajax更新框架中页面的位置。但是当设置散列的位置时(特别是在Chrome和某些版本的IE(5.5)上,但偶尔在IE7上)页面正在重新加载。下面的html演示了这个问题。主框架....frame.html是sethash.html页面是.varCount=0;functionsethash(){top.document.location.hash="hash"+Count;Count++;}Hello`在大多数浏览器上加载frame.html将在页面加载时显示一次加载警报。然后当按下设置哈希按钮时,url将被更改,但加载的警报的哈希将不会再次显示。在chrome和某些版本的I

javascript - 如何在JavaScript中改变window.location.href然后执行更多的JS?

我有代码片段,它是在点击如下链接时执行的cj_redirecturl="/HomeWork/main/load_course";utility.xhttprw.data(cj_redirecturl,{data:courseid},function(response){if(response){window.location.href=base_url+"main";///nextutility.xhttprw.data(redirecturl,{data:""},function(response){if(response){id=ent;document.getElementByI

javascript - 为什么 window.location 追加而不是替换 ie 中的 URL

我在ie中收到错误的URL,但在firefox和chrome中却没有。基本上,我有一个名为文本搜索的文本字段。我在htaccess中使用jQuery和rewriterule来内部重定向页面。我在本地主机上,所有文件都在一个名为test的文件夹中。在firefox和chrome中,如果您在文本搜索框中输入“你好”按回车键、“嗨”按回车键和“再见”按回车键,您将获得正确的URL作为本地主机/测试/测试/你好和本地主机/测试/测试/嗨和本地主机/测试/测试/再见分别。在即你得到本地主机/测试/测试/你好和本地主机/测试/测试/测试/嗨和本地主机/测试/测试/测试/测试/再见分别这里的问题是“

javascript - 为什么 window.location.search 是空的?

如果我console.log(window.location)我得到这个:Location{replace:function,assign:function,ancestorOrigins:DOMStringList,origin:"https://localhost:3000",hash:"#/account/content?hello=world"…}ancestorOrigins:DOMStringListassign:function(){[nativecode]}hash:"#/account/content?hello=world"host:"localhost:3000"

没有 www 的 Javascript location.host

我有一个php文件,用于在Facebook和Twitter上分享我的用户的帖子。例如,如果我点击Twitter图标,我会看到一个屏幕,其中自动写入了指向我网站的超链接。这很好,但我想删除自动显示在Twitter屏幕上的url的www.部分。我猜这与location.host有关,所以我用google搜索,但找不到这个问题的正确答案。这是我的代码示例:functione(f,i,an){with(document){write('');write(' ');write('');write('');write('(#'+i+')');document.write(' '

javascript - window.location.indexOf 在 Javascript 中不起作用

下面是我的。varmyString="http://localhost:8888/www.smart-kw.com/";alert(myString.indexOf("localhost"));这会提醒我...但是如果我将varmyString="http://localhost:8888/www.smart-kw.com/";更改为varmyString=window.location;,它不起作用(我没有收到警报)。varmyString=window.location;alert(myString.indexOf("localhost")); 最佳答案