Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/437.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript İ;在xlink中包含Svg文件:href=";#获取数据_Javascript_Ajax - Fatal编程技术网

Javascript İ;在xlink中包含Svg文件:href=";#获取数据

Javascript İ;在xlink中包含Svg文件:href=";#获取数据,javascript,ajax,Javascript,Ajax,单击发布数据时,Svg文件中的这段代码#P082195,我需要使用javascipt获取数据并直接发送到asp文件 <a xlink:href="#P082195"> 元素addEventListener(“单击”,函数(str) { 如果(str==“”) { document.getElementById('svg-container')。innerHTML=xhr.responseText; 返回; } if(window.XMLHttpRe

单击发布数据时,Svg文件中的这段代码#P082195,我需要使用javascipt获取数据并直接发送到asp文件

    <a xlink:href="#P082195">


元素addEventListener(“单击”,函数(str)
{
如果(str==“”)
{
document.getElementById('svg-container')。innerHTML=xhr.responseText;
返回;
}
if(window.XMLHttpRequest)
{//IE7+、Firefox、Chrome、Opera、Safari的代码
xmlhttp=新的XMLHttpRequest();
}
其他的
{//IE6、IE5的代码
xmlhttp=新的ActiveXObject(“Microsoft.xmlhttp”);
}
open(“GET”、“getsvg.asp?#”+str,true);
xmlhttp.send();
}
你能帮我一下吗?我被困在这里了

    <script>
    
    elem.addEventListener("click", function(str) 
    {
    if (str=="")
      {
      document.getElementById('svg-container').innerHTML = xhr.responseText;
      return;
      }
    if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
      }
    else
      {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp.open("GET","getsvg.asp?#"+str,true);
    xmlhttp.send();
    }
    </script>