Skip to main content

Search and Top Navigation

#8840 closed bug (notabug)

Opened November 21, 2012 10:24AM UTC

Closed November 21, 2012 02:03PM UTC

JQuery UI opens multiple dialogs when facing an XML header

Reported by: urskr Owned by:
Priority: minor Milestone: 1.10.0
Component: ui.dialog Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:
Description

Using JavaScript's XMLSerializer, I convert some XML to HTML.

In Firefox, the resultant HTML is prefaced with XML metadata:

When I hand this into jquery's dialog function, multiple dialogs open.

The code behaves as expected in Chrome, since the XMLSerializer doesn't add the XML metadata.

var content = new XMLSerializer().serializeToString(result);

//<?xml version="1.0" encoding="UTF-8"?><myXML></myXML>

$(content).dialog();

Attachments (0)
Change History (2)

Changed November 21, 2012 12:02PM UTC by urskr comment:1

_comment0: As a workaround, I can remove the XML header: \ var content = new XMLSerializer().serializeToString(result); \ var cleanContent = content.replace(/<\\?.*\\?>/, "");1353499381220094

As a workaround, I can remove the XML header:

var content = new XMLSerializer().serializeToString(xml);

var cleanContent = content.replace(/<\\?.*\\?>/, "");

Changed November 21, 2012 02:03PM UTC by scottgonzalez comment:2

resolution: → notabug
status: newclosed

This is correct. If you call dialog on two nodes, you'll get two dialogs.