1
attr에 추가 OnClick 어떻게이 두통을 가지고슬래시가 JQuery와 아약스 피드에서 제거,
강령 :
<script type="text/javascript" language="javascript">
$(document).ready(function(){
$("#dvContent").append("<ul class='list'></ul>");
$.ajax({
type: "GET",
url: "file.xml",
dataType: "xml",
success: function(xml){
$(xml).find('entry').each(function(){
var sTitle = $(this).find('title').text();
// HERE I Need to add onClick attr
// Por example (added to <a>)
$("<li></li>").html("<a onclick='example('https://yahoo.com/');' href='http://google.com/'>" + sTitle + '</a>').appendTo("#dvContent ul");
// but I'ts the Result: (with-out Slash and ['])
$("<li></li>").html("<a onclick="example(" https:="" www.yahoo.com=""');'" href='http://google.com/'>" + sTitle + '</a>').appendTo("#dvContent ul");
$("<li></li>").html("<a href='http://google.com/'>" + sTitle + '</a>').appendTo("#dvContent ul");
});
},
error: function() {
alert("An error occurred while processing XML file.");
}
});
}); </script>
19 함께 aprox<a>
내가 [onclick='example('http://yahoo.com/');']
어떻게 해결할 수 있습니까?
나는