When a page is Liked or referenced on Facebook, Facebook requests the URL from their end, downloads the HTML, and parses it using a very simplified HTML parser that looks for OpenGraph tags.
For this reason, only the HTML generated directly by the server will be seen by Facebook. Any JavaScript embedded in the HTML will not get run, nor will any resources referenced by the page be loaded.
You'll need to figure out some way to communicate the information by manipulating the URL; such as adding URL parameters, assigning a permalink to the content, using re-write rules on the web server, etc.