Note that there are some explanatory texts on larger screens.

plurals
  1. POThe <a> tag is not parsed in the AJAX
    text
    copied!<p>When I use AJAX tech. to generate the HTML, I find the tag is not be parsed by the browser and just be printed as its original string in a table. What's may be problem?</p> <pre><code>var html = "&lt;table border=\"1\" style=\"border: 1px solid; text-align: center; font-family: Times New Roman; font-size: 12px;\"&gt;"; html += "&lt;tr&gt;&lt;td&gt;&lt;b&gt;Cover&lt;/td&gt;&lt;td&gt;&lt;b&gt;Title&lt;/b&gt;&lt;/td&gt;&lt;td style=\"width: 100px;\"&gt;&lt;b&gt;Movie Dutation&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Showtime&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Tweet&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;"; for(var i = 0; i &lt; movies.movies.movie.length; ++i){ var movie = movies.movies.movie[i]; var cover = movie.cover; var title = movie.title; var duration = movie.duration; var showtime = movie.showtime; var theatre = movie.theatre; var url = movie.url; var twitter = "I am planning to watch #" + title + " @ " + theatre + "... " + url; html += "&lt;tr&gt;"; html += "&lt;td&gt;" + "&lt;img " + "src=" + cover + "&gt;" + "&lt;/td&gt;"; html += "&lt;td&gt;" + title + "&lt;a href=\"\"&gt;helloWorld&lt;/a&gt;" + "&lt;/td&gt;"; html += "&lt;td&gt;" + duration + "&lt;/td&gt;"; // The &lt;a&gt; tag would not be parsed. html += "&lt;td&gt;" + showtime + "&lt;/td&gt;"; html += "&lt;td&gt;" + "&lt;a href=\"https://twitter.com/share\" class=\"twitter-share-button\"" + " data-url=\"blog.denglitao.org\"" + " data-counturl=\"blog.denglitao.org\"" + " data-text=\"" + twitter + "\"" + " data-count=\"vertical\"" + "&gt;Tweet&lt;/a&gt;" + "&lt;/td&gt;"; html += "&lt;/tr&gt;"; } html += "&lt;/table&gt;"; document.getElementById("content").innerHTML = html; </code></pre> <p>showtime is the string containing the tag.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload