document

How can I modify the title of a site using JavaScript?

南楼画角 提交于 2019-12-20 07:36:55
问题 When viewing a torrent page, the title of the tab is: Bitsoup.org The Best site for your Torrent appetite :: Details for torrent "ABC" where "ABC" is the name of the torrent file. Unfortunately, when I have 3+ tabs open, I can not see what the name of the torrent file is. I am attempting to create a Greasemonkey script to truncate, or split, the title, so that it only displays the torrent-name, and not the beginning part. I am aware that you can modify the title associated with a page by

how to use document.getElementById() in Nodejs

╄→尐↘猪︶ㄣ 提交于 2019-12-20 05:26:24
问题 i'm trying to get elements by id from an html file in a js file using nodejs. I'm getting the error 'document id not defined' because node doesn't provide a document object model by default. So how can i use document.getElementById() in nodejs ? Thank you ! 回答1: If you want to parse files within the same server you should probably use some of this options, because nodejs it's just a JavaScript implementation, There is no window or document object, see this. But to answer exactly your question

How does jQuery.post() deal with Content-Disposition: attachment?

我们两清 提交于 2019-12-20 05:16:24
问题 Going slightly crazy here. I'm making an Ajax call using jQuery.post as follows: $.post('php/print.php',{data:dS},function(res){... },"text"); I'm returning from print.php (as a test): header("Content-type: application/vnd.ms-word"); header("Content-Disposition: attachment;Filename=test.doc"); echo "<html>"; echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=Windows-1252\">"; echo "<body>"; echo "Testing-2-3!"; echo "</body>"; echo "</html>"; The data is coming through fine

How does jQuery.post() deal with Content-Disposition: attachment?

两盒软妹~` 提交于 2019-12-20 05:16:06
问题 Going slightly crazy here. I'm making an Ajax call using jQuery.post as follows: $.post('php/print.php',{data:dS},function(res){... },"text"); I'm returning from print.php (as a test): header("Content-type: application/vnd.ms-word"); header("Content-Disposition: attachment;Filename=test.doc"); echo "<html>"; echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=Windows-1252\">"; echo "<body>"; echo "Testing-2-3!"; echo "</body>"; echo "</html>"; The data is coming through fine

Opening Word Document on Client Side from Asp.net Application

一世执手 提交于 2019-12-20 04:26:36
问题 We need to open a word document which is located on a server on the clients machine using Microsoft Word. The solution is working locally however when deployed on server then only thing that happens is that the winword.exe is started on the server. Is this possible to do using interop or javascript? this is the code till now Microsoft.Office.Interop.Word.ApplicationClass wordApp = new Microsoft.Office.Interop.Word.ApplicationClass(); object file = FilePath + FileName; lblError.Text = lblError

Adding custom shapes to JTextpane and saved to new Word document

我与影子孤独终老i 提交于 2019-12-20 04:22:45
问题 If I load a Word document into a JTextPane , is there a way I could drop a custom shape in it, then save it as a new Word document? The results I'm looking for are just like dropping a shape anywhere onto the document using Insert-> Shapes in MS Word. 回答1: docx4all is a Swing-based docx editor. Like DocxEditorKit, it is built on top of docx4j. You'd need to extend it to support the functionality you are describing. 回答2: You can try to extend the DocxEditorKit http://java-sl.com/docx_editor

PHP domDocument to remove child nodes of a child node

孤人 提交于 2019-12-20 03:14:44
问题 How do I remove a parent node of a child node, but keep all the children? The XML file is this: <?xml version='1.0'?> <products> <product> <ItemId>531<ItemId> <modelNumber>00000</modelNumber> <categoryPath> <category><name>Category A</name></category> <category><name>Category B</name></category> <category><name>Category C</name></category> <category><name>Category D</name></category> <category><name>Category E</name></category> </categoryPath> </product> </products> Basically, I need to

MongoDB Java pull

坚强是说给别人听的谎言 提交于 2019-12-19 19:43:48
问题 i tried to remove an embedded document without succcess. I'm looking for the java way of following instruction: db.games.update({'_id': 73}, {$pull: {'goals': {'goal': 4}}}) 回答1: The Java documentation is pretty clear, you are just constructing BSON objects to match their respective JSON counterparts as used in the shell: BasicDBObject query = new BasicDBObject("_id", 73); BasicDBObject fields = new BasicDBObject("goals", new BasicDBObject( "goal", 4)); BasicDBObject update = new

what exactly document-ready means in jquery

瘦欲@ 提交于 2019-12-19 03:57:46
问题 Let us say I have a HTML page that contains a javascript file: The base.js is like this: $(document).ready(function () { obj.init(); } // .............. var obj = {...}; Surprisingly, sometimes (not all the time) Firebug shows me the undefined error on obj.init() call! My understanding is that document ready means all html elements, including images, javascript files downloaded and executed(?). I believe in order to find the root cause of this error, we need understand what exactly the

get all html as a String from HTMLDocument

坚强是说给别人听的谎言 提交于 2019-12-19 02:52:09
问题 Im coding in Java.. Does anyone know how i can get the content of a javax.swing.text.html.HTMLDocument as a String? This is what i´ve got so far... URL url = new URL( "http://www.test.com" ); HTMLEditorKit kit = new HTMLEditorKit(); HTMLDocument doc = (HTMLDocument) kit.createDefaultDocument(); doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE); Reader HTMLReader = new InputStreamReader(url.openConnection().getInputStream()); kit.read(HTMLReader, doc, 0); I need the content of the