link not found, 404 error

Georgi Koemdzhiev

I am doing a small school project that is basically a web app that searches nearby restaurants by keywords = restaurant and the specific cuisine that the user chooses. However, I have a problem when getting the website of the place and putting it in "a" tag and when I press the link to test it, it says that the page cannot be found. But the link works perfectly when I copy and paste the link in a new tab in the browser.

This is the jquery that deals with the json output of my request:

var restaurantContactDetails = "https://maps.googleapis.com/maps/api/place/details/json?reference="+restaurant_reference+"&key=API_KEY";
$.getJSON(restaurantContactDetails,function(jsondata){
    $("#restaurant_contact").html("Contacts: " + "<p> UK: " + jsondata.result.formatted_phone_number+ ","+ " International: " + jsondata.result.international_phone_number+"</p>");
    //$("#restaurant_contact").append("<p> International: " + jsondata.result.international_phone_number+"</p>");
    var website = jsondata.result.website;
    //alert(website);
    console.log(website);
    $("#restaurant_website").append("<a href=website >" + website+"</a>");
    for(var i = 0; i < Object.keys(jsondata.result.reviews).length;i++){                
        $("#Client_reviews").append("<p class=rust_reviews>"+"<h4 class=text-success>"+jsondata.result.reviews[i].author_name+"</h4>"+"<pre>"+jsondata.result.reviews[i].text+"</pre>");
    }
});

I should mention that the place website sometimes is a specific link like this: http://www.premierinn.com/en/hotel/ABEPTI/aberdeen-city-centre?cmp=GLBC Any suggestions?

dsharew

Try this:

 $("#restaurant_website").append("<a href=" + website + ">" + website+"</a>");

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Page not found(404) error if reset password email link is wrong in django

From Dev

Error 404: Not Found Fuseki

From Dev

Codeigniter 404 Not Found Error

From Dev

Error: 404 NOT FOUND

From Dev

Error 404 - Not Found Wildfly

From Dev

php link not found error

From Dev

Why do I get a "404 Not Found" error even though the link is on the server?

From Dev

Why do I get a "404 Not Found" error even though the link is on the server?

From Dev

Codeigniter pagination link go to 404 Page Not Found

From Dev

Codeigniter pagination link go to 404 Page Not Found

From Dev

404 error - Resource not found in Bluemix

From Dev

Laravel ajax 404 not found error

From Dev

Bottle Python Error 404: Not found: '/'

From Dev

Code Igniter, Not Found 404 Error

From Dev

Resource not found in Jersey (Error 404)

From Dev

error "404 Page Not Found" in codeigniter

From Dev

Laravel routing 404 error not found

From Dev

Resource not found in Jersey (Error 404)

From Dev

Page not found (404) Error in Django

From Dev

Laravel Object not found Error 404

From Dev

404 page not found error in Codeigniter

From Dev

Error 404 page not found in wordpress

From Dev

Page not found(404) error in django

From Dev

WebService Error: 404 Not found - No context found for request

From Dev

Django Page not found(404) error (Library not found)

From Dev

Bundled css link gets a 404 error

From Dev

Make a back to previous url link in error 404

From Dev

Show failure link in 404 error custom page

From Dev

XAMPP URL with 'error' end to 404 Not found