xhtml

Escaping HTML in jQuery so it's valid

别来无恙 提交于 2019-12-24 07:30:33
问题 I've followed advice from firebug and W3C links, however when Firebug confirms all is valid, W3C does not seem to like it and vice versa. All I'm doing is this: return '<a href="#"></a>'; I believe I should use a backslash infront of the forward slash, though as XHTML, the start tag needs to be escaped as well? Can anyone shed any light on this. Thanks. 回答1: Short answer: Don't use XHTML on the client. Almost the short answer: Put your JavaScript in external files Longer answer: If you really

unable to color faces using indexedfaceSet in x3dom

时光怂恿深爱的人放手 提交于 2019-12-24 05:26:36
问题 I am looking for a way to display some meshes with color mapping in Chrome browser, so I have tried x3dom and indexedFaceSet . I assume there is a way to assign colors to vertices so that the color of the face is interpolated or at least I should be able to assign different constant color to each face. It seems that no matter what I try, I can only display lines of the faces and defined colors have no effect. Currently, I have this html code: <html> <head> <script type='text/javascript' src=

Jquery fadeOut on hover

青春壹個敷衍的年華 提交于 2019-12-24 03:45:17
问题 I need a bit of help with jquery to get a fadeOut effect happening, here is my code: http://jsfiddle.net/PPpnT/25/ When you hover over the image the image needs to fade out and show the red underneath, when you mouse off the image should fade back. I think the code may need a stop function - just having a hard time writing it. All suggestions welcome! 回答1: In your specific jsFiddle, use this: $('#show').hover(function() { $(this).stop(true).fadeTo("slow", 0); }, function() { $(this).stop(true

How to remove anchor link's dotted focus outlines only for mouse events but not for keyboard tabbed navigation?

▼魔方 西西 提交于 2019-12-24 03:35:21
问题 For anchor links i want to removes the dotted focus outlines for mouse events, but want to display them when for keyboard tabbed navigation.? Is there any javascript, jquery method? Method should be compatible all A-grade browsers. including IE6. Although all pure css methods to remove dotted lines do not works in IE 6. But remember i want to remove dotted focus outlines only for mouse events , but want to display them when user use keyboard tabbed navigation. 回答1: Try to use jQuery

Parse XHTML using Ruby

假如想象 提交于 2019-12-24 03:08:39
问题 Is there any way I can parse a remote html page, in Ruby, preferably using jQuery like selectors? For example, I could select all the div having a specific class, and get the content of all those elements in an array. I was trying to use Regex for this, but I think using XML parser would be better. 回答1: I found hpricot is very similar. 来源: https://stackoverflow.com/questions/2722443/parse-xhtml-using-ruby

ASP.NET MVC support for HTML output (as opposed to XHTML)

老子叫甜甜 提交于 2019-12-24 01:45:28
问题 It seems to me that ASP.NET MVC Html Helpers only output XHTML-like tags (closed empty elements), which is not valid HTML. Is there support for HTML output in ASP.NET MVC? 回答1: True... it'll output typically: <input type="text /> You could certainly write your own HTML Helpers to cover any cases you want. 回答2: As pcampbell hinted, you probably need to write your own Html helper to do this. However, it doesn't have to be too hard - if you notice you need one, for example for an <input> element

Getting the the text of an <a> with XPath when it's buried in another tag e.g. <strong>

核能气质少年 提交于 2019-12-24 01:25:56
问题 The following XPath is usually sufficient for matching all anchors whose text contains a certain string: //a[contains(text(), 'SENIOR ASSOCIATES')] Given a case like this though: <a href="http://www.freshminds.net/job/senior-associate/"><strong> SENIOR ASSOCIATES <br> </strong></a> The text is wrapped in a <strong> , also there's also a <br> before the anchor closes, and so the above XPath returns nothing. How can the XPath be adapted so that it allows for the <a> containing additional tags

Do i need to specify CSS for media=“handheld” and use of CSS media queries if I'm making a simple mobile site for iphone, android, blackberry only?

喜欢而已 提交于 2019-12-24 01:17:51
问题 Do i need to specify CSS for media="handheld" and use of CSS media queries media="only screen and (max-device-width:xxxpx) " if I'm making a simple mobile site for iphone, android, blackberry only? Or media="all" or media="screen" would be enough? I'm only targeting Blackberry 4.6+, iphone and android. 回答1: It depends on what kind of devices/browsers are you targeting at. For example s60 browsers behave differently than iPhone, Android, Opera mini and similar browsers. Here is a nice article

Non Rectangular CSS Image Links

我是研究僧i 提交于 2019-12-23 23:08:41
问题 I have the following requirement: A large image contains several 'hotspots' that need to link to other pages. Sounds simple. I have created a simple html page, a div with the background image and absolute positioned links using CSS with image sprite rollovers. However, I have now been presented with another image and the hotspots are not square, but irregular shapes. In one example they are similar to surfboards. Any ideas how I can get the links to respond to only the actual bounding box of

How to change the default look of radio button, not functionality?

孤街浪徒 提交于 2019-12-23 22:18:45
问题 On a form I've two radio button Yes and No . I want to change the default look of radio buttons to like this. Edit: I would like to change the radio buttons into <a> anchor when JavaScript is enabled if it's not easy to change the look of default radio via css. 回答1: Easiest way? Set the images as labels with the for attribute pointing to the radio buttons. Then set the radio buttons to display:none; <input type="radio" name="radio[1]" /><label for="radio[1]"><img src="/yes.png"></label>