2016-05-22 12 views
0

私のコードに問題があるため、モデルのボディコンテンツが繰り返し表示されます。ボタンをクリックするたびに誰かが助けてくれますか?ボディコンテンツ繰り返しモーダルコンテンツ

function loadXMLDoc(filename) { 
if (window.ActiveXObject) { 
    xhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
} 
else { 
    xhttp = new XMLHttpRequest(); 
} 
xhttp.open("GET", filename, false); 
try { xhttp.responseType = "msxml-document" } catch (err) { } // Helping IE11 
xhttp.send(""); 
return xhttp.responseXML; 
}; 

function ShowForm() { 

xml = loadXMLDoc("../XSLT/DecForm.xml"); 
xsl = loadXMLDoc("../XSLT/DeclarationForm.xslt"); 

if (document.implementation && document.implementation.createDocument) { 
    xsltProcessor = new XSLTProcessor(); 
    xsltProcessor.importStylesheet(xsl); 
    resultDocument = xsltProcessor.transformToFragment(xml, document); 
    document.getElementById("DeclarationDataDiv").appendChild(resultDocument); 
} 

$('#myModal').on('show.bs.modal', function (event) { 

    var modal = $(this) 
    modal.find('.modal-title').text("Declaration Form") 

}) 
$('#myModal').modal('show'); 

return false 
}; 

答えて

0
function ShowForm(){ 
xml = loadXMLDoc("../XSLT/DecForm.xml"); 
xsl = loadXMLDoc("../XSLT/DeclarationForm.xslt"); 

if (document.implementation && document.implementation.createDocument) { 
    xsltProcessor = new XSLTProcessor(); 
    xsltProcessor.importStylesheet(xsl); 
    resultDocument = xsltProcessor.transformToFragment(xml, document); 
    $("#DeclarationDataDiv").html("").append(resultDocument); 
} 
$('#myModal').on('show.bs.modal', function (event) { 
    var modal = $(this) 
    modal.find('.modal-title').text("Declaration Form") 
}) 
$('#myModal').modal('show'); 
return false};