如何使用HTML / CSS / JavaScript开发桌面应用程序?(How to develop Desktop Apps using HTML/CSS/JavaScript? [closed])
首先,我没有兴趣做这个专业。 我是一名Web开发人员,我最近离职的Spotify的同事,他表示他将主要使用JavaScript进行Spotify Desktop应用程序。 他表示,它使用“Chrome框架”,内部的一切都像网页应用程序(HTML / JS / CSS)一样完成。
作为一名没有为桌面制作任何东西的网络开发人员,这是一个好消息。 如果我可以使用我已经知道的技术,并将它们实现在某种“框架”中,并且仍然可以构建一个Windows或更好的跨平台应用程序。
我知道我没有提到数据库,但即使是一个简单的hello world桌面应用程序与网络技术将是很好的去。
那么怎么会这样呢? 我需要/需要知道什么?
First, I'm not interested in doing this professionally. I am a web developer, a coworker of mine recently left for Spotify and said he will be working mostly in JavaScript for the Spotify Desktop app. He said it uses "Chrome frame" and everything inside is done like a web app (HTML/JS/CSS).
As a web developer who never built anything for Desktop, this is great news. If I can use the technologies I already know and implement them inside some sort of a "frame" and still be able to build a windows or better yet cross platform app.
I know I didn't mention anything about the database, but even a simple hello world desktop app with web technologies would be great to get going.
So how does one go about this? Exactly what do I need/need to know?
原文:https://stackoverflow.com/questions/12232784
最满意答案
尝试使用
descendant-or-self
轴//span/descendant-or-self::*[normalize-space() = 'my cool text']
请注意,
normalize-space
不会删除单词之间的空格在这里演示 - http://www.xpathtester.com/obj/fdbdafbe-22a5-4fac-a249-30c92dcb143a
如果你真的需要将文本与删除的所有空格匹配,这似乎有效......
//span/descendant-or-self::*[translate(normalize-space(), ' ', '') = 'mycooltext']
演示 - http://www.xpathtester.com/obj/e893f3e1-6d57-445c-9802-d7525bcd6b31
Try using the
descendant-or-self
axis//span/descendant-or-self::*[normalize-space() = 'my cool text']
Note that
normalize-space
won't remove the spaces between the wordsDemo here - http://www.xpathtester.com/obj/fdbdafbe-22a5-4fac-a249-30c92dcb143a
If you really need to match the text with all spaces removed, this seems to work...
//span/descendant-or-self::*[translate(normalize-space(), ' ', '') = 'mycooltext']
Demo - http://www.xpathtester.com/obj/e893f3e1-6d57-445c-9802-d7525bcd6b31
相关问答
更多-
删除内部文本 - XPath(Delete Inner Text - XPath)[2021-08-25]
将SelectSingleNode方法的结果转换为XmlElement并将IsEmpty属性设置为true: DirectCast(xml.SelectSingleNode("/root/child1"), XmlElement).IsEmpty = true; Cast SelectSingleNode method result to XmlElement and set IsEmpty property to true: DirectCast(xml.SelectSingleNode("/root/ ... -
XSL和XPATH问题匹配(XSL and XPATH issue match)[2023-11-26]
如果您想了解XSL转换的作用,请使用一个工具来显示实际生成的代码(例如xsltransform.net) - 而不是浏览器。 - michael.hor257k 我非常同意这一点,请使用例如http://xsltransform.net/ 。 TL; DR: /是文档节点, /*是输入文档的最外层元素 从第一个样式表获得的输出是- type="text/xsl" href="cd.xsl"
-
尝试使用descendant-or-self轴 //span/descendant-or-self::*[normalize-space() = 'my cool text'] 请注意, normalize-space不会删除单词之间的空格 在这里演示 - http://www.xpathtester.com/obj/fdbdafbe-22a5-4fac-a249-30c92dcb143a 如果你真的需要将文本与删除的所有空格匹配,这似乎有效...... //span/descendant-or-self ...
-
XPath 1.0不提供转义引号的方式。 相反,使用单引号作为您的XPath字符串分隔符,因为您可以通过将它们加倍来避免SQL中的单引号: select xpath(E'//book[title = ''["a book"]'']/price/text()', xmlparse(document b.content))::text[] from booksite b XPath 1.0 provides no way of escaping quotes. Use single-quote ...
-
包含文本的div的Xpath(Xpath for a div containing text)[2022-07-26]
要查找包含任何文本的节点,只需使用:// div [5] / div / div [2] / div [text()] To find node that contains any text simply use: //div[5]/div/div[2]/div[text()] -
如果字符串出现在另一个字符串中,则contains只能测试。 group/text()不是字符串,它是节点的集合/序列。 您可以使用 //element[group/text() = "Group 1"] contains can only test, if a string occurs in another string. group/text() is not a string, it is a set/sequence of nodes. You can use //element[group/t ...
-
以下XPath表达式, //UserId/text() 会选择? 按照要求。 笔记: UserId没有名称空间,因此您不需要paf:UserId 。 如果有多个UserId ,您可以将UserId[1]添加到表达式中。 UserId上没有text属性,因此您不需要UserId/@text ,但UserId下面有一个text()节点,因此您需要UserId/text() 。 如果UserId下面可能有进一步的标记,您可能需要其字符串值string(//UserId) ,而不是选择其子文本节点。 The fo ...
-
一个更简单,更具前瞻性的策略是将XPath表达式分离为搜索所需WebElements的2/3个不同表达式,但如果您确实需要使用单个XPath表达式,我想您可以使用| 运营商设计的东西: //input[@type="text" or @type="password"] | //textarea A simpler and more future-proof strategy would be separate the XPath expression into 2/3 distinct expression ...
-
Text是它自己的文本节点,因此正确的选择器将是: .//div[@id='id']/text() Text is its own text node, so the correct selector would be: .//div[@id='id']/text()
-
使用/使用XPath意味着从文档的根目录开始,这不是您想要的。 xpath将找到所有匹配的元素,这意味着还将找到包含所需文本的所有祖先节点,从而导致根目录下的所有内容满足条件。 这是一个显示这个的例子: require 'nokogiri' xml = '' doc = Nokogiri::XML(xml) doc.xpath("/*[contains(., 'foobar')]").map(&:to_ht ...
foobar