标签: document

如果元素存在于DOM中或者它是虚拟的(仅由createElement创建),如何使用javascript查找

我正在寻找一种方法来查找javascript中引用的元素是否已插入到文档中.

让我们用以下代码说明一个案例:

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
Run Code Online (Sandbox Code Playgroud)

Jquery有:可见选择器,但当我需要找到隐藏元素放在文档中的某个位置时,它不会给出准确的结果.

javascript virtual document element exists

8
推荐指数
2
解决办法
3万
查看次数

我在哪里可以获得文档签名证书

看起来我到处都看到它们是usb密钥上的个人证书,它们用于证明个人身份.我有一个用PDF格式生成文档的网站.我想签名,以便他们以我们网站发布的方式可信,并且没有被篡改......

使用self创建的certficiate这样做对我来说很有用,但是只有当它是我的最后一个选项时我才能使用它,所以 - 我在哪里可以购买证书进行文档签名?

编辑 - 对于所有使用GENERIC回答此问题的人"任何证书颁发机构都会做"请更具体.他们(Goddady,Verisign,Entrust等)出售USB设备上的邮件和文件安全证书,这对我来说无济于事.

pdf document certificate

8
推荐指数
1
解决办法
6488
查看次数

如何在基于NetBeans的项目中将javaDoc添加到我的Java代码中?

如何将JavaDoc或其他文档添加到netbeans?
我试着用这种方式:

Tools >> Java Platform >> JavaDoc Tab >> JavaDoc.zip (in my desktop) 
Run Code Online (Sandbox Code Playgroud)

但在编辑器中,当我在tooltiptext中按Ctrl+ Space时显示以下消息:

找不到Javadoc.此项目的Javadoc文档不存在,或者您未在Java Platform Manager或库管理器中添加指定的Javadoc.

我尝试重新启动NetBeans,但结果如下:

在此输入图像描述

java netbeans javadoc document

8
推荐指数
3
解决办法
4万
查看次数

将文档作为null [#document:null]使用DocumentBuilder在java中解析XML之后

在解析documengt之后,即使文档包含数据,我也会变为空.这是我的代码,我已将所有验证设置为false.

DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();

    domFactory.setNamespaceAware(false); // never forget this!
    domFactory.setCoalescing(false);
    domFactory.setValidating(false);
    domFactory.setFeature("http://xml.org/sax/features/namespaces", false);
    domFactory.setFeature("http://xml.org/sax/features/validation", false);
    domFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false);
    domFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
    domFactory.setFeature("http://apache.org/xml/features/allow-java-encodings",
                       true);



    DocumentBuilder builder = domFactory.newDocumentBuilder();

    builder.setEntityResolver(new EntityResolver() {
        public InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
                throws SAXException, java.io.IOException {
            if (publicId.equals("--myDTDpublicID--"))
                // this deactivates the open office DTD
                return new InputSource(new ByteArrayInputStream("<?xml version='1.0' encoding='UTF-8'?>".getBytes()));
            else return null;
        }
    });


    Document doc = null;
    URL url = new URL(urlStr);
    URLConnection urlc = url.openConnection();



    doc = builder.parse(urlc.getInputStream());
    System.out.println("doc:" + doc.toString());
Run Code Online (Sandbox Code Playgroud)

回应如下:

doc:[#document: …
Run Code Online (Sandbox Code Playgroud)

xml null document

8
推荐指数
1
解决办法
3万
查看次数

NetworkOnMainThread

我尝试实现以下代码时收到NetworkOnMainThreadException:

public class HandlingXMLStuff extends ListActivity{
static final String URL = "xml_file";

 static final String ITEM = "item"; //parent
    static final String Id = "id";
    static final String Name = "name";
    static final String Desc = "desc";
    static final String Link = "Link";

@Override
public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.xmllist);

ArrayList<HashMap<String, String>> menuItems = new ArrayList<HashMap<String, String>>(); 

xmlparser parser = new xmlparser();
String xml = parser.getXmlFromUrl(URL);
Document doc = parser.getDomElement(xml);


NodeList nl = doc.getElementsByTagName(ITEM);


//START: loop through all item nodes …
Run Code Online (Sandbox Code Playgroud)

parsing android document xml-parsing

8
推荐指数
1
解决办法
6502
查看次数

iPad上UIDocumentInteractionController的可能错误:presentPreviewAnimated没有被推入导航堆栈

仅限iPad:UIDocumentInteractionController presentPreviewAnimated未被推入导航堆栈,即使从documentInteractionControllerViewControllerForPreview返回导航控制器时也只显示模态

大家好

我想知道是否有人可以在这里帮助我,我相信这可能是一个只与iPad有关的错误(它可以在iPhone上运行),但在我提交之前需要确认.

为了让UIDocumentInteractionController在导航控制器中工作,我按照推荐的方法返回导航控制器表单documentInteractionControllerViewControllerForPreview,但它不起作用.

我甚至尝试将Apple提供的UIDocumentInteractionController代码示例升级到iPad,果然,即使我从documentInteractionControllerViewControllerForPreview返回导航控制器,文档交互控制器也会以模态显示.但是对于iPhone来说,它确实会被推入导航堆栈.

我试图设计一个基于splitviewcontroller的应用程序,使用文档交互控制器读取PDF文件,这样PDF将显示在DetailViewController中,但这仅适用于QLPreviewController(不是Doc交互控制器).

有没有人有这个问题?我把下面的示例代码放在我看到的图像中:

我正在使用iOS 6.0 SDK.

static NSString* documents2[] =
{
    @"PDF Document.pdf"
};

@implementation WhizTBViewController

@synthesize documentURLs, docInteractionController;

#pragma mark -
#pragma mark View Controller

- (void)setupDocumentControllerWithURL:(NSURL *)url
{
    if (self.docInteractionController == nil)
    {
        self.docInteractionController = [UIDocumentInteractionController interactionControllerWithURL:url];
        self.docInteractionController.delegate = self;
    }
    else
    {
        self.docInteractionController.URL = url;
    }
}


- (void)previewDocument {
    // three ways to present a preview:
    // 1. Don't implement this method and simply attach the canned gestureRecognizers to the cell …
Run Code Online (Sandbox Code Playgroud)

controller document interaction modalviewcontroller ios6

8
推荐指数
1
解决办法
1215
查看次数

将其他属性添加到现有文档elasticsearch

如何在Elasticsearch索引中向现有文档添加其他属性.

$ curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d '{
"user" : "kimchy",
"post_date" : "2009-11-15T14:12:12",
"message" : "trying out Elastic Search"
}'
Run Code Online (Sandbox Code Playgroud)

这将在索引中创建一个文档.如何向文档添加属性?假设

"new_attribute":"new_value"
Run Code Online (Sandbox Code Playgroud)

这会将文件修改为

"user" : "kimchy",
"post_date" : "2009-11-15T14:12:12",
"message" : "trying out Elastic Search"
"new_attribute" :"new_value"
Run Code Online (Sandbox Code Playgroud)

indexing document updating elasticsearch

8
推荐指数
2
解决办法
2万
查看次数

UIWebview(iOS)中的Docx支持?

我已经检查了文档支持的官方链接,并且很清楚UIWebview中不支持docx,

https://developer.apple.com/library/ios/qa/qa1630/_index.html

但是,我也发现有些人能够在UIWebview中打开docx文件,

无法使用OpenIn功能在应用程序中通过webbrowser打开docx文件, 为什么doc和docx在iOS中丢失样式信息?, 如何在iPhone中打开Microsoft Office文档

另外,iOS Safari浏览器是基于UIWebview建立的,我可以在浏览器中从互联网上打开docx文件.但是当我从我的测试服务器下载docx时(我已经通过从模拟器导入它来交叉检查下载的docx并且它在我的mac上完全打开),我无法在UIWebview中查看它.

我很困惑,docx是否支持?或者似乎docx有更多种格式,有些格式支持?

这是我的加载代码,

NSURLRequest *request = [NSURLRequest requestWithURL:urlPath];
[webViewForDocsView loadRequest:request];
Run Code Online (Sandbox Code Playgroud)

iphone document objective-c uiwebview ios

8
推荐指数
2
解决办法
7840
查看次数

没有为类型“CollectionReference”定义方法“document”。颤动/Firebase

没有为类型“CollectionReference”定义方法“document”。尝试将名称更正为现有方法的名称,或定义名为“document”的方法。

我在我的项目中遇到此错误。你能帮助我吗?

我的代码:

import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:crypto_app/models/users.dart';

class FireStoreService {
  final FirebaseFirestore _firestore = FirebaseFirestore.instance;
  final DateTime time = DateTime.now();

  Future<void> createUser({id, mail, userName, photoUrl = ""}) async {
    await _firestore.collection("users").doc(id).set({
      "userName": userName,
      "mail": mail,
      "photoUrl": photoUrl,
      "about": "",
      "createTime": time
    });
  }

  Future<Users> bringUser(id) async {
    DocumentSnapshot doc = await _firestore.collection("users").doc(id).get();
    if (doc.exists) {
      Users users = Users.dokumandanUret(doc);
      return users;
    }
    return null;
  }

  void userUpdate({String userId, String userName, String photoUrl = ""}) {
    _firestore
        .collection("users")
        .document(userId)
        .updateData({"userName": userName, …
Run Code Online (Sandbox Code Playgroud)

document firebase flutter

8
推荐指数
1
解决办法
7120
查看次数

嵌入式文档中的mongodb限制

我需要创建一个消息系统,一个人可以与许多用户进行对话.例如,我开始与user2,user3和user4交谈,因此他们中的任何人都可以看到整个对话,如果对话在任何时间都不是私密的,任何参与者都可以将任何其他人添加到对话中.

这是我的想法如何做到这一点.我正在使用Mongo,我的想法是使用对话框作为实例而不是消息.

架构如下所示:

{
_id : ...., // dialog Id
'private' : 0 // is the conversation private
'participants' : [1, 3, 5, 6], //people who are in the conversation
'msgs' :[
  {
   'mid' : ...// id of a message
   'pid': 1, // person who wrote a message
   'msg' : 'tafasd' //message
  },
  ....
  {
   'mid' : ...// id of a message
   'pid': 1, // person who wrote a message
   'msg' : 'tafasd' //message
  }
]
}
Run Code Online (Sandbox Code Playgroud)

我可以看到这种方法的一些优点 - 在一个大型数据库中,很容易找到某些特定会话的消息. …

document mongodb mongodb-php

7
推荐指数
1
解决办法
5226
查看次数