English 中文(简体)
• 如何为 has子获取关键编码?
原标题:How to get keycode for hash #?
  • 时间:2011-11-13 14:21:21
  •  标签:
  • javascript

请允许我了解一下 has(#)的关键标识是什么? 我通过一些资源进行了搜索,但找不到。 能否为这一编号找到关键编码? 如何了解其他图象? 感谢。

最佳回答

无论用什么文字,你都可以找到关键编码,简单地操作这一守则(现在在你手中):

document.onkeypress = function (e) { console.log(e.which); };

然后,你对这封信重新感兴趣,并将在圣殿上展示。

# is 35, btw.

问题回答

其ASCII价值为35。

全文见here

However, assuming user is typing it by pressing Shift+3 then you ll need to catch the key code of the digit 3 (which is 51) plus check the shiftKey property of the event object: when true and the key code is 51 it means # was typed.
(The above is correct only for specific keyboard layout, sorry)

,使用<代码>onkeypress探测关键中风。

出于某种原因,35名牙医为我工作。 编号为51为我工作。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签