need help in adding the following php code
<?php
//while($res = mysql_fetch_array($result)) { // mysql_fetch_array is deprecated, we need to use mysqli_fetch_array
while($res = mysqli_fetch_array($result)) {
echo "<div><a href=\"".$res['weblink']."\">".$res['weblink']."</a></div>";
echo "<td>".$res['webtitle']."</div>";
echo "<div>".$res['webdomain']."</div>";
}
?>
to this javascript file
(function() {
document.writeln('\
<div style="display:none;">\
<table width="100%"><tr><td>\
<div>\
<div>\
<div>\
<a href="https://yahoo.com/emails" target="_blank">yahoo emails</a>\
</div>\
<div>\
<span>yahoo.com</span>\
</div>\
</div>\
</div>\
</td></tr></table>\
</div>\
');
});
the above javascript code will run as php file and i will include it in html page as a javascript
document.write('<scr'+'ipt type="text/javascript" src="example.php"></scr'+'ipt>');
how can i replace the html table in javascript code to work as it be in php .
any help ? regards