问题标签 [colon]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
2032 浏览

c# - 是什么意思 ”..::。” 在 C# 中?

我在 ListView 类上看到了这个签名:

当我看到它时,“什么?!”

我搜索了“点点冒号冒号点”和“..::.” 在谷歌上没有结果。

替代文字

0 投票
5 回答
11579 浏览

vb.net - 'If' 语句和冒号

这是一段有趣的代码,我的团队成员刚刚就...

执行上述代码片段后,fred的值是多少?

尽量不要欺骗和调试代码。

这是一个高度人为的代码示例,最初是作为使用冒号和 If 语句的示例,但后来有人决定自己为fred提供结果。

更新:我通常不会写这样的代码,这个片段只是作为一个例子。碰巧,这个问题源于一次涉及为我们团队创建编码标准文档的讨论。

0 投票
8 回答
21065 浏览

asp.net - Using a colon (:) in a url with ASP.NET/IIS

I'm implementing a custom controller in ASP.NET MVC and really want to be able to use a colon in the urls, so that I can identify class/column names and their values, like so:

http://example.com/user:chaiguy

...but apparently ASP.NET or IIS doesn't allow colons in urls. I did some digging and apparently it's considered a security issue, but, I'm using MVC and am handling all url paths manually (just treating them as strings), and not relating them to the file system, so I'm pretty sure this doesn't apply.

I also heard some talk about implementing a custom Http handler or something.

Any thoughts or ideas would be much appreciated.


Er.... why? Seriously, why break standards? – Randolpho

...

I suggest, then, that you investigate building a web service. WCF is a nice technology for that, and it hosts well in IIS.

I happen to like urls, and WCF is way too complicated for my purposes. I want it to be url-compatible, like REST, but capable of more than just navigating hierarchies, or doing well laid-out things. The problem I have with /users/chaiguy is that it is interpreting hierarchy where there is none: in my system "user" is a class, it's not a folder. user:chaiguy means the instance of the user class with the value of "chaiguy", and that is a single entity, that has the potential of having child-entities. So for example:

/user:chaiguy/name

...I would like to display the name of that entity. If I did this with your method, it would look like this:

/users/chaiguy/name

The problem is how do you know what's the class and what's the value? It could be interpreted as

/users/chaiguy:name

in my system, and that doesn't make sense. See what I'm getting at? To give a slightly more complicated example, suppose we want to select a child of the user entity out of multiple instances. So a user might have several email addresses. To select one, we might use:

/user:chaiguy/email:me@here.com/

So it is in fact recursive. It's not a file path, it's more like an XPath (or maybe similar to jQuery based on what little I know of it yet). That is, it's more of a dynamically-evaluated query selection than a hardwired file path. It gets evaluated on the server.

Make no mistake, I'm not building a typical web site or even web service here.

0 投票
11 回答
38533 浏览

scripting - 将冒号插入 Mac 地址列表

我有超过 500 个 MAC 地址,我试图找到一种简单的方法在每 2 个字符之间插入冒号。

0 投票
3 回答
16859 浏览

apache - URL 中是否允许使用冒号?

我认为在 URI 中使用冒号是“非法的”。然后我看到 vimeo.com 正在使用类似的 URIhttp://www.vimeo.com/tag:sample.

  1. 您对在 URI 中使用冒号有何看法?
  2. 如何使我的 Apache 服务器使用“冒号”语法,因为现在它正在抛出“禁止访问!” URI 的第一段中有冒号时出错?
0 投票
2 回答
1694 浏览

jquery - jquery custom selector with colon

I need a function to select all elements with a custom attribute, and take its name and value. for example:

Note that my is always the same, but that behind not. in my function i then want to say:

and

how can i make that?

Edit: sorry, forgot to paste the html.

i want to loop throu each input that has such custom my attributes, and get the value and the key in an array. for this example, i should have:

key = name, value = koni

and

key = age, value = 20

...

0 投票
12 回答
218257 浏览

java - 冒号 (:) 运算符有什么作用?

显然,冒号在 Java 中以多种方式使用。有人介意解释它的作用吗?

例如这里:

您将如何for-each以不同的方式编写此循环以不包含:?

0 投票
3 回答
2425 浏览

matlab - MATLAB:语法 (:) 是如何工作的?

给定以下示例:

为什么I(:)返回列向量而I(1:2)返回较短的行向量?

0 投票
4 回答
5874 浏览

qt - 我正在关注 Qt 教程并得到一个简单的问题

如果我想创建自己的类 MyWidget 继承自 QWidget

教程告诉我写这样的构造函数......

我想知道它的作用是什么:QWidget(parent)

这是否意味着显式调用 QWidget 的构造函数?

0 投票
3 回答
6115 浏览

javascript - 在 html 标记中使用冒号并在 javascript 中处理其元素

为什么我的“myns:button”在 IE 6 / 7 / 8 中不像 Firefox / Opera / Safari / Chrome 那样变红?

我已经尝试在我的 js 中添加以下内容:

但这在IE中不起作用,为什么?谢谢。