Can not put a variable of a txt file with tag html in a text element svg
Hi,
I want to retrieve the text part between tag html from the load command.
For this I use an svg file directly in my html page and the load command of jquery.
If I download from a text file without html tag it works well:
$ ("# DivA"). Load ("demo_test1.txt");
If I download from a file containing html tags this does not work.
$ ("# DivA") load ("demo_test.txt # p2");
A remark in my example the "div" works in both casesBelow my file:
demo_test.txt:
*****************
<p id="p1" >It works fine</p>
<p id="p2" style="color:blue">I use the local text file
:demo_test.txt:
******************
I use the local text file "demo_test1.txt".
The text of svg works fine without tag but doesn't work with tags
fichier html:
*************
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="
https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#divA").load("demo_test1.txt" );
$("#div1").load("demo_test.txt #p2");
});
</script>
</head>
<body>
<div id="div1"><h2>PSU0 to PDU-A G0-2</h2></div>
<svg width="800" height="480" xmlns="
http://www.w3.org/2000/svg" xmlns:svg="
http://www.w3.org/2000/svg" >
<rect id="svg_1" height="87" width="162" y="20" x="5" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" stroke="blue" fill="yellow"/>
<text xml:space="preserve" text-anchor="start" font-family="serif" font-size="14" id="divA" y="60" x="180" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" stroke="#000000" fill="blue"> </text>
</svg>
</body>
</html>
I would like to use the file with tags as this will allow me to download only one file and filter the information I want by the selector. Can you help me.
B.R,