0

This is my question, I have an index.html that has a table populated with a jQuery ajax function. I want to know how do I link each table element to a single page called details.html that should be populated using some parameter from index.html (e.g. details.html?id=2 has different data than details.html?id=9 but they both have the same structure)

Assuming that I can only use html and jquery, how would I do that?

I mean, how (in details.html) can I get the id=2 or id=9 parameter?

Thanks in advance (I'm sorry if this question is kind of noobish, but I'm not so used to html)

mgXD-2
  • 102
  • 7

1 Answers1

0

Well, if you really want to do it like that use something like this:

var url = document.URL;
var tmpURL = url.split("?id=").pop();

In tmpURL is the value of id parameter (from your example 2 or 9). Hope it helps.

Wolf87
  • 540
  • 3
  • 11
  • 29