custom-data-attribute

HTML 5 Browser Compatibility Chart - HTML 5 in Old Browsers?

落花浮王杯 提交于 2019-12-23 07:14:50
问题 I have just started considering using the HTML 5 api for a Rails/JQuery project, so I can use that great data- attribute to store values. I am worried though about browser compatibility issues. I have two questions (basic questions): In order to use HTML 5, do people need to upgrade their browsers? How does that work? Is there an up-to-the-day chart of what features each browser layout engine supports, more up-to-date than this Wikipedia article on comparing HTML layout engines and this When

Create an array from list of articles tag's data attribute

怎甘沉沦 提交于 2019-12-23 02:05:08
问题 I want to create an array that I will assign to a marker variable, this is to display markers in google maps. but all that I have is the data attribute from article tag. this what I'm working on: http://jsfiddle.net/gilbertlucas46/qpvdrjh8/7/ if you check the console it will show you this this is what I want to achieve var markers = [ ['Palace of Westminster, London', -27.4687253, 153.0273166], ['Palace of Westminster, London', -27.4687253, 153.0273166] ]; this is the code that I have to

Does Google's data-nosnippet break the convention for the “data-” attribute prefix? Is it the first to do so?

。_饼干妹妹 提交于 2019-12-21 04:32:06
问题 Today, in a blog post entitled More options to help websites preview their content on Google Search, Google announced new behaviour for the Google search engine. The part that interests me is that Googlebot will now interpret the HTML attribute data-nosnippet like this: A new way to help limit which part of a page is eligible to be shown as a snippet is the " data-nosnippet " HTML attribute on span , div , and section elements. With this, you can prevent that part of an HTML page from being

Universal CSS selector to match any and all HTML data-* attributes [duplicate]

雨燕双飞 提交于 2019-12-19 19:40:12
问题 This question already has answers here : CSS selector for attribute names based on a wildcard (3 answers) Closed 3 years ago . Is it possible to match all nodes that have a data-* attribute using only CSS? Here are examples of attributes I would like to match: data-scope data-sessionlink data-visibility-tracking I could do *[data-scope] *[data-sessionlink] *[data-visibility-tracking] but I am looking for something more compact. Furthermore, I don't know all possible data-* attributes I might

Set custom data- attributes on {{#linkTo}} helper <a> tag

余生颓废 提交于 2019-12-18 11:46:02
问题 How can I set custom data- attribute on the {{#linkTo}} helper? I want use this: {{#linkTo "foo" data-toggle="dropdown"}}foo{{/linkTo}} and the result should look like this: <a id="ember323" class="ember-view active" data-toggle="dropdown" href="#/foo/123">foo</a> but it looks like: <a id="ember323" class="ember-view active" href="#/foo/123">foo</a> How can I do this? 回答1: A way you could do this is to extend your Ember.LinkComponent to be aware of the new attribute: Ember.LinkComponent

jQuery Validate custom messages

…衆ロ難τιáo~ 提交于 2019-12-17 20:04:10
问题 I have an input that I want to display a custom error message on when the user doesn't fill it out. <input type="text" class="foo" value="" data-prop="foo" data-rules="{ required: true }"></input> How do I add a custom error message to this specific input? 回答1: Use: data-msg-required="Please enter something here!" Here's a demo HTML code: https://github.com/jzaefferer/jquery-validation/blob/master/demo/custom-messages-data-demo.html JS Fiddle demo: http://jsfiddle.net/leniel/VuPPy/48/ 来源:

How to select elements with jQuery that have a certain value in a data attribute array

两盒软妹~` 提交于 2019-12-17 19:02:06
问题 is there a way in jQuery to select elements that have a certain value in a data attribute array? Consider this snippet of html: <li id="person1" data-city="Boston, New York, San Fransisco"> Person name 1 </li> <li id="person2" data-city="Los Angeles, New York, Washington"> Person name 2 </li> What is the best way in jQuery to select all persons with "New York" in the data-city attribute? The solution should take in account that certain citynames appear in other city names (in example 2:

Why should I prepend my custom attributes with “data-”?

耗尽温柔 提交于 2019-12-17 04:07:10
问题 So any custom data attribute that I use should start with "data-": <li class="user" data-name="John Resig" data-city="Boston" data-lang="js" data-food="Bacon"> <b>John says:</b> <span>Hello, how are you?</span> </li> Will anything bad happen if I just ignore this? I.e.: <li class="user" name="John Resig" city="Boston" lang="js" food="Bacon"> <b>John says:</b> <span>Hello, how are you?</span> </li> I guess one bad thing is that my custom attributes could conflict with HTML attributes with

How to use dashes in HTML-5 data-* attributes in ASP.NET MVC

淺唱寂寞╮ 提交于 2019-12-17 02:25:12
问题 I am trying to use HTML5 data- attributes in my ASP.NET MVC 1 project. (I am a C# and ASP.NET MVC newbie.) <%= Html.ActionLink("« Previous", "Search", new { keyword = Model.Keyword, page = Model.currPage - 1}, new { @class = "prev", data-details = "Some Details" })%> The "data-details" in the above htmlAttributes give the following error: CS0746: Invalid anonymous type member declarator. Anonymous type members must be declared with a member assignment, simple name or member access. It works

jQuery selectors on custom data attributes using HTML5

和自甴很熟 提交于 2019-12-16 22:34:11
问题 I would like to know what selectors are available for these data attributes that come with HTML5. Taking this piece of HTML as an example: <ul data-group="Companies"> <li data-company="Microsoft"></li> <li data-company="Google"></li> <li data-company ="Facebook"></li> </ul> Are there selectors to get: All elements with data-company="Microsoft" below "Companies" All elements with data-company!="Microsoft" below "Companies" In other cases is it possible to use other selectors like "contains,