GitHub资源是由搜索引擎解析的吗?(Is GitHub sources parsed by search engines? [closed])
如果我将它们放在GitHub上,Google和其他搜索引擎会将我的源代码编入索引吗?
Will Google and other search engines index my source code if I keep them on GitHub?
原文:https://stackoverflow.com/questions/8261855
更新时间:2023-06-06 15:06
最满意答案
你可以添加一个
toString
方法给你的对象,它返回你想要的。 在这种情况下,href
例如:
var obj = { href:'', toString:function(){ return this.href; } }; obj.href = 'http://stackoverflow.com'; obj.toString();
You can add a
toString
method to your object that returns what you want. In that casehref
eg:
var obj = { href:'', toString:function(){ return this.href; } }; obj.href = 'http://stackoverflow.com'; obj.toString();
相关问答
更多-
你可以得到 document.URL,但你不能设置它。 您可以同时获取并设置document.location.href 。 在某些webbrowsers中,您可以设置document.URL但请不要,因为它在大多数浏览器中都不起作用。 你自己给了答案! var currentURL = document.URL; alert(currentURL); 在这里了解更多 You can get the document.URL, but you can not set it. You can both ge ...
-
您可能直接设置location ,因为它稍短。 如果你想简单,你通常可以省略window. 太。 location.href和location URL分配被定义为在JavaScript 1.0中工作,在Netscape 2中,并且已经在每个浏览器中实现。 所以请选择并使用您最清楚的一个。 You might set location directly because it's slightly shorter. If you're trying to be terse, you can usually om ...
-
这应该做到这一点... location = 'user-profile.aspx?username=' + (location.pathname).replace('/',''); This should do it... location = 'user-profile.aspx?username=' + (location.pathname).replace('/','');
-
为什么location.toString()报告与location.href报告相同?(Why does location.toString() report the same as location.href?)[2022-07-23]
你可以添加一个toString方法给你的对象,它返回你想要的。 在这种情况下, href 例如: var obj = { href:'', toString:function(){ return this.href; } }; obj.href = 'http://stackoverflow.com'; obj.toString(); You can add a toString method to your object that returns what you want. In ... -
你试过这个: $(document).ready(function () { alert('Page has finished loading'); }); 编辑:删除了第二部分答案,因为有目的的重定向否定了它的有用性 Have you tried this: $(document).ready(function () { alert('Page has finished loading'); }); EDIT: Removed second portion of answer since th ...
-
我想它应该是这样的。 setTimeout(function() { if (window.confirm("Go?")) { location.href = "/some/url"; } }, 10000); I guess it should be something like this. setTimeout(function() { if (window.confirm("Go?")) { location.href = "/some/url ...
-
由于您未包含协议(例如http),因此您的浏览器会将www.google.com解读为http://www.example.com/www.google.com的链接,因为您目前使用的是http://www.example.com 。 添加你想要的任何协议到href字符串,但如果你指的是网站本身以外的其他地方,你必须有协议。 Since you did not include a protocol (such as for example http), your browser will interpret ...
-
http://example.com/test.html?test=是无效的网址。 浏览器的位置字段不仅限于有效的URL - 在解析输入URL时,它们几乎可以接受任何内容,包括路径中的无效字符,查询字符串和片段。 发送到服务器的请求是已解析URL的序列化版本,并且始终是有效的URL,通过编码不能合法地存在于URL的各个部分中的字符的百分比来获得。 URL是一个抽象概念: location.href返回一个字符串,该字符串在语义上等同于用于将浏览器导航 ...
-
由于同源策略而发生此错误。 您无法在跨域iframe内的非扩展源中运行任何Javascript。 也就是说,iframe来自与主页面不同的域。 I determined that this error was coming from some JS tracking code that was including some flash to do it's tracking inside the iFrame, turned off the flash portion and this error disa ...
-
简单的方法:(不需要RegeEx) var url = "sub.domain.com" url = url.substring(0, url.lastIndexOf(".")) document.write(url) The simple way: (no RegeEx needed) var url = "sub.domain.com" url = url.substring(0, url.lastIndexOf(".")) document.write(url)