1

I'm making a web app to save bookmarks. I have a quick add feature that adds the URL to the favourites and collects the Title and Description for the site. So far I've got this:

var url = "http://google.co.uk";
var title = "";
var description = "";

$.get(url, function(data) {
  description = $(data).find('meta[name=adescription]').attr("content");
  title = $(data).find(title).text();
});

Unfortunately, this code does not work. Please help me fix it :). Thanks

Jake Walker
  • 75
  • 1
  • 9

1 Answers1

1

Your code has some typos:

  1. $get should be $.get - documentation here
  2. running the corrected code may still throw some errors in the console. The errors are related to cross origin restrictions.

Here is a link that explains the problem.

I hope this helps.

Community
  • 1
  • 1
Alex Pap
  • 46
  • 3