document

How to find with javascript if element exists in DOM or it's virtual (has been just created by createElement)

谁说胖子不能爱 提交于 2019-12-01 00:47:55
问题 I'm looking for a way to find if element referenced in javascript has been inserted in the document. Lets illustrate a case with following code: var elem = document.createElement('div'); // Element has not been inserted in the document, i.e. not present document.getElementByTagName('body')[0].appendChild(elem); // Element can now be found in the DOM tree Jquery has :visible selector, but it won't give accurate result when I need to find that invisible element has been placed somewhere in the

document.readyState not working in Firefox and Chrome

╄→尐↘猪︶ㄣ 提交于 2019-12-01 00:40:56
In my application, I am calling a method for every 1000ms to check the document readyState. Following is the code which I am using, var success=setInterval(""CheckState()"",1000); function CheckState(){ if($get('businessDownl').document.readyState=="interactive" || $get('businessDownl').document.readyState=="complete"){ alert("Great"); clearInterval(success); } } This code works fine in IE browser.But fails in Firefox and Chrome browser. I tried using $get('businessDownl').readyState also, it is printing as undefined. Can anybody tell me how to use the readyState for FF and chrome in the above

make document available for download through java/servlet

南笙酒味 提交于 2019-11-30 20:06:37
问题 I need to know if there is a way in java/servlet to make documents(doc,pdf) stored in database available for download to users in requested way(please see below), for example there is a web page and the link for document in it right now it is done this way: if the user clicks that link than a new blank window opens and there the download dialog box is shown and the user is able to download the document but that blank window stays open and the user have to close it manually but wish to do it

document.readyState not working in Firefox and Chrome

让人想犯罪 __ 提交于 2019-11-30 19:56:12
问题 In my application, I am calling a method for every 1000ms to check the document readyState. Following is the code which I am using, var success=setInterval(""CheckState()"",1000); function CheckState(){ if($get('businessDownl').document.readyState=="interactive" || $get('businessDownl').document.readyState=="complete"){ alert("Great"); clearInterval(success); } } This code works fine in IE browser.But fails in Firefox and Chrome browser. I tried using $get('businessDownl').readyState also, it

How do I execute a page-defined JavaScript function from a Firefox extension?

感情迁移 提交于 2019-11-30 19:28:43
I'm creating a Firefox extension for demo purposes. I to call a specific JavaScript function in the document from the extension. I wrote this in my HTML document (not inside extension, but a page that is loaded by Firefox): document.funcToBeCalled = function() { // function body }; Then, the extension will run this on some event: var document = Application.activeWindow.activeTab.document; document.funcToBeCalled(); However it raises an error saying that funcToBeCalled is not defined. Note: I could get an element on the document by calling document.getElementById(id); It is for security reasons

Relative and absolute tolerance definitions in Matlab solver

偶尔善良 提交于 2019-11-30 18:55:23
I am trying to understand the following Matlab definitions for RelTol and AbsTol parameters: RelTol — This tolerance is a measure of the error relative to the size of each solution component. Roughly, it controls the number of correct digits in all solution components, except those smaller than thresholds AbsTol(i).The default, 1e-3, corresponds to 0.1% accuracy. AbsTol — AbsTol(i) is a threshold below which the value of the ith solution component is unimportant. The absolute error tolerances determine the accuracy when the solution approaches zero. I do not understand why AbsTol determines

Confused by document dimensions in JavaScript

梦想的初衷 提交于 2019-11-30 15:55:25
I am really confused by the different properties that exist in JavaScript for getting the dimensions of a document and how to get those numbers. Can someone recommend a good place to start to understand how I would get the size of the document and position stuff correctly? dkugappi I'll try to answer as simply as I can. The Document and Viewport In terms of geometry, there are two sets of dimensions to be aware of; the document dimensions, which reflect the entire size of the loaded page, including the content beyond the bottom of the window and the viewport dimensions, which reflect the size

Flash document viewer

早过忘川 提交于 2019-11-30 14:40:15
Is there a flash based document viewer? I am looking for something similar to iPaper that Scribd.com uses. There's a great open source viewer for PDF2SWF: http://www.devaldi.com/?page_id=260 I've used PDF2SWF in the past to do basic document conversion/viewing in Flash: http://www.swftools.org/pdf2swf.html although I don't think they are as full featured as the iPaper and Scribd viewers - although it is entirely free to use. You can download from here: http://www.swftools.org/download.html It allows you to convert any PDF file into a multi-frame swf. You can optionally embed a viewer into the

How do I get the Window object from the Document object?

落花浮王杯 提交于 2019-11-30 10:40:59
I can get window.document but how can I get document.window ? I need to know how to do this in all browsers. The Window object is the top level object in the JavaScript hierarchy , so just refer to it as window Edit: Original answer before Promote JS effort. JavaScript technologies overview on Mozilla Developer Network says: In a browser environment, this global object is the window object. Edit 2: After reading the author's comment to his question (and getting downvotes), this seems to be related to the iframe's document window. Take a look at window.parent and window.top and maybe compare

Document Size in MongoDb

妖精的绣舞 提交于 2019-11-30 10:13:22
Thinking of switching to DynamoDB in future, but want to make sure my documents are under the 1KB, as they charge per KB. Is there a quick way to know how large a document is in a collection? As a general guide you can check the average size of documents in a collection collname using the avgObjSize value reported by collection stats() : db.collname.stats() To find and count large documents you can use something similar to: var maxSize = 1024; var bigDocs = 0; db.collname.find().forEach( function (doc) { var docSize = Object.bsonsize(doc); if (docSize >= maxSize) { bigDocs++; print(doc._id + '