dom

inline copy paste JEditorPane HTML

左心房为你撑大大i 提交于 2020-01-15 12:33:19
问题 I'm desperatly trying to implement a customized copy/paste in a JTextPane in HTML mode. The most part is working well, I get the html content using EditorKit.write(), I paste it using editorKit.read(). Perfect world. BUT, when I have : <p> test </p> in my editor and I try to copy "es" to obtain <p> tesest </p> , I obtain instead <p>tes</p> <p>es</p> <p>t</p> Knowing that, I m trying to figure out a way to paste "inline" the part supposed to be inline, and in block the part which was in block

jQuery Append order?

强颜欢笑 提交于 2020-01-15 12:32:10
问题 I'm creating a series of comments, with replies to the comments below them. I use this code to append the new reply underneath the comment. $(document).on('click', '.sub-reply1-send', function() { var reply = $('textarea[name=comment-reply]').val(); $('.sub-reply1, .sub-reply1-textarea, .sub-reply1-send').slideUp(250).remove(); $('.answer').append("<div class='comment-sub-reply' style='display:none'>" + reply + "</div>"); $('.comment-sub-reply').slideDown(250); subreply_visible = false; });

JavaScript: Need help ordering my JS “Uncaught TypeError: Cannot read property 'value' of null”

我的梦境 提交于 2020-01-15 12:20:13
问题 I am an amateur JS person so be kind with your voting as I am new to this. I am getting Uncaught TypeError: Cannot read property 'value' of null. I realize the issue is with the order of my js and the order in which it is calling DOM, but I am not sure exactly where. Someone mind helping point me in the right direction? Here is my code: <title></title> </head> <body> <form> <input id="todoItem" type="text" placeholder="Todo Item" /> <input type="button" value="Save" onclick="insert();" /> <

Specification Document: DOM Text Nodes

六月ゝ 毕业季﹏ 提交于 2020-01-15 12:14:29
问题 I am reading a document about HTML5. A few lines down from where I linked, a sample DOM tree is displayed for the sample HTML code given. Why is there no text node directly before the <head> element? Why is there no text node between the DOCTYPE and <html> nodes? Error or feature? 回答1: Feature. The main reason is that, given the markup <!DOCTYPE html> <html> <head> <title>Sample page</title> ..., some people expect document.documentElement.firstChild to return the head element. However, if

Specification Document: DOM Text Nodes

╄→гoц情女王★ 提交于 2020-01-15 12:09:16
问题 I am reading a document about HTML5. A few lines down from where I linked, a sample DOM tree is displayed for the sample HTML code given. Why is there no text node directly before the <head> element? Why is there no text node between the DOCTYPE and <html> nodes? Error or feature? 回答1: Feature. The main reason is that, given the markup <!DOCTYPE html> <html> <head> <title>Sample page</title> ..., some people expect document.documentElement.firstChild to return the head element. However, if

Using PHP DOM want to show all string as a output

邮差的信 提交于 2020-01-15 09:41:09
问题 Here, is my html string in $data variable in php, and that string have some text like <140/90 mmHg OR <130/80 mmHg this line not showing when i run this code using PHP DOMDocument because when coming less-than & grater-than signs its problematic. <?php $data = 'THE CORRECT ANSWER IS C. <p>Choice A Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s</p> <p></p> <p>Choice B Lorem Ipsum is simply

dynamically inserted form inputs aren't posted

走远了吗. 提交于 2020-01-15 09:33:26
问题 I don't usually actually ask for help, but when I do, believe me I did my research well and found nothing. Lets make it simple, but relevant.I have a form. Part of it goes like this: <div class="list-model"> <div class="connected"><?=$items['connected']?></div> <div class="items"><?=$items['items']?></div> </div> When somebody clicks an input , i want to move it to another div . I use jQuery for that: $(".list-model").delegate(".item input", "change", function() { listModel = $(this).closest(

Why Firefox event.offsetX and offsetY are undefined?

冷暖自知 提交于 2020-01-15 08:17:04
问题 I just stumbled upon a bug in my software that happened only on Firefox. The reason was that the event didn't have offsetX and offsetY defined. I managed to fix it thanks to this. Anyways, my question is not a programming help request. I'm just curious why these properties are undefined in Firefox? What is the reason behind it? I did look through: DOM3 UIEvent Spec., DOM3 MouseEvent Spec. and DOM2 MouseEvent Spec.. It appears that neither of the properties are mentioned there, so, I suppose

DOMXML, PHP4 => PHP5

故事扮演 提交于 2020-01-15 08:14:09
问题 I have a script running on a server with PHP4 that uses DOMXML. Now I have to migrate the site (incl. the script) to a new server running PHP5 and it seems that DOMXML isn't working properly anymore. Is there an easy way to fix this? Thanks. 回答1: In PHP5 the DOMXML was replaced by DOM: http://www.php.net/manual/ref.dom.php For migration check this page: http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/index.en.html 来源: https://stackoverflow.com/questions/610124/domxml-php4-php5

How can i get the position number of an element?

混江龙づ霸主 提交于 2020-01-15 08:07:09
问题 Is there any plugin in firefox or function in firebug or something else, that lets me se the position number of a specific element? If i for example want to know the what position a specific TD element has compared to all the TD's in the document. EXAMPLE: <html> <head> <body> <table> <tr> <td></td> (0) <td></td> (1) <td></td> (2) <td></td> (3) <td></td> (And so on...) <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <------ WHAT IS THE POSITION NUMBER OF THIS