I don’t know what exactly is the problem here, but I need to make the PhoneNumber, Website and Email into hyper links and I don’t really know where to start.
I tried something before using the anchor tag, but it didn’t work. The info is stored on my SQL table and it is being accessed by a PHP script that allows this script to use the data, just need to make the necessary links.
function geo() {
var id = $.QueryString("id"),
id = (!id) ? "null" : id; // Passing the value null to string
var loadUrl = 'http://localhost/test/detail.php';
$.getJSON('http://localhost/test/detail.php?id=' + id, function (data) {
$.each(data, function (key, val) {
if (val.Image != "" && val.Image != null) {
$('#placePic').attr('src', 'images/' + val.Image);
} else {
$('#placePic').attr('src', 'images/default_image2.jpg');
}
if (val.Name != "" && val.Name != null) {
$('#placeName').text(val.Name);
}
$("#list_All").html("");
if (val.PhoneNumber != "" && val.PhoneNumber != null) {
$("#list_All").append("<li><h3>Phone Number :</h3>" + val.PhoneNumber + "</li>");
} else {
$("#list_All").append("<li><h3>Phone Number :</h3>No Data Found</li>");
}
if (val.Address != "" && val.Address != null) {
$("#list_All").append("<li><h3>Address :</h3>" + val.Address + "</li>");
} else {
$("#list_All").append("<li><h3>Address :</h3>No Data Found</li>");
}
if (val.Email != "" && val.Email != null) {
$("#list_All").append("<li><h3>Email ID :</h3>" + val.Email + "</li>");
} else {
$("#list_All").append("<li><h3>Email ID :</h3>No Data Found</li>");
}
if (val.Website != "" && val.Website != null) {
$("#list_All").append("<li><h3>Website :</h3>" + val.Website + "</li>");
} else {
$("#list_All").append("<li><h3>Website :</h3>No Data Found</li>");
}
$("#pom_btn").attr("href", "http://localhost/test/on_map.html?id=" + val.userId + "&lat=" + val.Lat + "&lon=" + val.Lon);
});
});
}
window.onload = function () {
geo();
}
Try this:
For the website link, you’ll need an “http://” or “https://” on the front of it. I did a simple test, but a more complete one might be needed depending on your case.