我想在搜索結果的網頁上顯示一條消息。下面是我的JS代碼。我保持DIV在HTML中爲空。在調用該函數後,瀏覽器中沒有顯示任何內容。我是新手請糾正我在做錯的地方。使用jquery輸出HTML內容
function test() {
var v = "<p class=""noresults""> <img src=""icons/oops-icon_small.jpg"" alt=""OOPS!"" > id=""img_align"" /> we did not find" + "any results relating to your search. </p>" + "<span > class=""noreult_home""> <a href=""#""><img src=""icons/home_icon.jpg"" alt=""Home""/> </a> ></span>";
$("div#con").html(v);
}
你的HTML是可怕無效。垃圾進垃圾出。 – Quentin
昆汀,感謝您在發帖後格式化我的問題我試圖糾正格式,因爲你是專家,你糾正它非常快。 – Balu