xhtml

PHP: How to prevent unwanted line breaks

强颜欢笑 提交于 2019-12-13 15:00:12
问题 I'm using PHP to create some basic HTML. The tags are always the same, but the actual links/titles correspond to PHP variables: $string = '<p style="..."><a href="'.$html[$i].'"><strong><i>'.$title[$i].'</i></strong></a> <br>'; echo $string; fwrite($outfile, $string); The resultant html, both as echoed (when I view the page source) and in the simple txt file I'm writing to, reads as follows: <p style="..."><a href="http://www.example.com "><strong><i>Example Title </i></strong></a></p> <br>

take user input from a Form perform calculation (order of operations) and output back into that form

旧时模样 提交于 2019-12-13 14:59:50
问题 I'm trying to take input from one element of Form (INPUT1) and perform a calculation which would essentially OUTPUT1=((INPUT1/20) .58) .30 I've seen a number of examples for conversion of CM to inches etc.. But nothing with order of operations. Please help! The wall and my head have met too many times. This is what I have so far, (which doesn't work) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transititonal//EN" ""http://www.w3.org/TR/XHTML1/DTD/xhtml1-transitional.dtd"> <html> <head></head>

XPath, in a Greasemonkey script, is not selecting right nodes on an XHTML page

我们两清 提交于 2019-12-13 14:54:38
问题 I'm working on a Greasemonkey script for weibo.com . I can't pick the elements using XPath on the XHTML page. This code fails to grab the elements I want: function resolver(prefix) { return prefix === 'x' ? 'http://www.w3.org/1999/xhtml' : null; } var allLinks, thisLink; allLinks = document.evaluate( "//x:a[@href]", document, resolver, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null ); Only the <a> elements on the sidebar are picked and the rest are still there. Please refer to this, weibo.com

Override the form 'Reset' behavior when data is refreshed via ajax

╄→尐↘猪︶ㄣ 提交于 2019-12-13 14:24:58
问题 I am relying on the "Reset" behavior of a form to cancel the edits, the problem i am facing is that once post the data is updated via ajax, the reset still reverts back to the data that was loaded with the page origionally. So basically what I need to be able to do is "Reset" the "Reset" function. Make sense? 回答1: Try this: $("#yourForm").bind("reset", function() { // reset the form manually with the "newest" data return false; }); In this case, you will have to store the new data (that you

Why does this JavaScript prototype function break jQuery?

橙三吉。 提交于 2019-12-13 13:06:25
问题 Question: As soon as I add the below code to my html page, I get: Line: 4 Error: Object doesn't support the property or method "exec". This is the prototype that causes the bug: Object.prototype.allKeys = function () { var keys = []; for (var key in this) { // Very important to check for dictionary.hasOwnProperty(key) // otherwise you may end up with methods from the prototype chain.. if (this.hasOwnProperty(key)) { keys.push(key); //alert(key); } // End if (dict.hasOwnProperty(key)) } //

Getting Selected Row Data from Datatable in JSF

谁说我不能喝 提交于 2019-12-13 12:17:30
问题 So, I have tried to implement the methods from Anthony/BalusC in this question: How to get selected row index in JSF datatable? but to no avail. I also went through @BalusC's "Using datatables" article (which is wonderful as always) but that was written for JSF1.2 and the 2.0 article doesn't really address getting the selected row data. When a user clicks the "Add to my favorites" button, the selected row is not getting passed to the backing bean, the navigation case is not being followed,

Please explain rowspan and colspan, col and colgroup

瘦欲@ 提交于 2019-12-13 11:39:22
问题 Can anyone explain rowspan and colspan , col and colgroup ? And are these W3C valid and semantically correct? Under which circumstances are these useful? 回答1: colspan <table border="1"> <tr> <th colspan="2">people are...</th> </tr> <tr> <td>monkeys</td> <td>donkeys</td> </tr> </table> rowspan <table border="1"> <tr> <th rowspan="2">monkeys are...</th> <td>... real monkeys</td> </tr> <tr> <td>... 'unreal' monkeys (people...)</td> </tr> </table> w3c as you see, this is for connecting table

2 div columns: fixed and liquid. Fixed one must be removable. Liquid one must be the first in code

假如想象 提交于 2019-12-13 11:34:49
问题 Consider the following 2 cols html structure: <div id="container"> <div class="left">some text</div> <div class="right">some text</div> </div> CSS: #container { overflow: hidden; } .left { float: left; width: 200px; background: red; } .right { overflow: hidden; background: green; } The same code in jsFiddle - http://jsfiddle.net/vny2H/ So we have 2 columns. The left column width is fixed, the width of the right one is liquid. If we remove the left column from html, the right column stretches

Is there any jquery version of IE7.js available?

泄露秘密 提交于 2019-12-13 10:32:56
问题 I need jquery version of IE7.js or any other similar jquery based js for same thing? http://code.google.com/p/ie7-js/ 回答1: This script has nothing to do with jQuery. You don't need a jQuery version of it. I'm leaving this answer for David's comment. 回答2: Large chunks of what IE7.js does are built into jQuery (providing you use the jQuery API to write your own functions). So the answer is: Yes, jQuery. As for the bits which it doesn't cover — you need to look for specific solutions for those

When zooming in, why does the footer overlap its preceding content

≡放荡痞女 提交于 2019-12-13 10:27:52
问题 here is the sample html: <div id = "mainWrapperDiv"> <div id = "mainDiv"> <div> testing </div> </div> </div> <div id = "footerDiv"> </div> its css: * { padding: 0px; margin: 0px; } body, html { height: 100% } div { border: none; } #mainWrapperDiv { min-height: 100%; height: 100%; margin-bottom: -200px; } #mainDiv { margin: 0px auto 0px auto; width: 1000px; min-height: 500px; background: lightgreen; } #footerDiv { height: 200px; width: 100%; position: relative; clear: both; background: