Note that there are some explanatory texts on larger screens.

plurals
  1. POParse XHTML page with jQuery, remove element and append to div
    primarykey
    data
    text
    <p>I get a url of an XHTML page (stored on my computer) thanks to jQuery and I want to parse this page and then remove items of my XML. </p> <p>My XHTML page</p> <pre><code>&lt;html&gt; ... &lt;exampleXML&gt; &lt;dataset&gt;a&lt;/dataset&gt; &lt;dataset&gt;b&lt;/dataset&gt; &lt;dataset&gt;c&lt;/dataset&gt; &lt;/exampleXML&gt; ... &lt;/html&gt; </code></pre> <p>My jQuery code </p> <pre><code>var url_val = $("#xhtml_page").val(); $.get(url_val, function(data) { $(data).find("dataset").each(function() { if ($(this).text() == "a"){ $(this).remove(); } }); $("#body-tmpl").html('&lt;div id="id_container"&gt;&lt;/div&gt;'); $("#id_container").html($(data)); }); </code></pre> <p>And When my items are removed I would send the contents of my new XHTML in a div.</p> <p>But unfortunately, I can not removed the XHTML elements (exemple a) and put the new page in a div. It is the best solution?</p> <p>Before attempting to remove items, I put my XHTML in an iframe.</p> <pre><code>&lt;iframe frameborder="0" style="width:100%; height:100%;" src="XHTMLfile.html"&gt; #document&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org /TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;&lt;html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; … &lt;/head&gt; &lt;body style="overflow: hidden; margin: 0px; font: 11px sans-serif; cursor: auto;"&gt; &lt;img id="hiddenImage" style="display:none" src="http://soft.sourceforge.net /img/hidden.png"&gt;&lt;/img&gt; &lt;img id="loadingImage" style="display:none" src="http://soft.sourceforge.net /img/loading.gif"&gt;&lt;/img&gt; &lt;img id="logo" style="display:none" src="http://soft.sourceforge.net/img/logo.png"&gt; &lt;/img&gt; &lt;noscript&gt; … &lt;/noscript&gt; &lt;div style="display:none"&gt; … &lt;/div&gt;&lt;div style="position: absolute; top: 1%; right: 2%; text-align: right;"&gt; … &lt;/div&gt; &lt;input type="button" value="x" style="position: fixed; visibility: visible; right: 10.5px; top: 492.333px;"&gt;&lt;/input&gt; &lt;canvas width="1000" height="700"&gt;&lt;/canvas&gt; &lt;div style="position: absolute; top: 0px;"&gt; … &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; &lt;/iframe&gt; </code></pre> <p>Now I have it when I put it in a div :</p> <pre><code> &lt;div id="id_container" style="width:1000px; height:700px;"&gt; &lt;meta charset="utf-8"&gt; &lt;/meta&gt;&lt;link href="http://soft.sourceforge.net/img/favicon.ico" rel="shortcut icon"&gt; &lt;/link&gt;&lt;img id="hiddenImage" style="display:none" src="http://soft.sourceforge.net/img/hidden.png"&gt;&lt;/img&gt; &lt;img id="loadingImage" style="display:none" src="http://soft.sourceforge.net/img/loading.gif"&gt;&lt;/img&gt; &lt;img id="logo" style="display:none" src="http://soft.sourceforge.net/img/logo.png"&gt;&lt;/img&gt; &lt;noscript&gt; … &lt;/noscript&gt; &lt;div style="display:none"&gt; … &lt;/div&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload