How to read URI querry / HTML URL parameter just with Java Script without any PHP? And how to attach the result to a new link with Java Script?

How to read URI querry / HTML URL parameter just with Java Script without any PHP? And how to attach the result to a new link with Java Script?

Hi. As PHP is not supported maybe you can help me on this...

I want to integrate a very specific webshop app into my website. At one page of my site there is a little search-box-form (integrated via iframe) which sends the values via URL parameters to a search-result-site at my website. At this search-result-site there again I have to call an iframe from the webshop. The iframe-source-link of this webshop-site should include the search querries submitted from little search-box-form as URI-querry / URL-parameter.

With PHP my search-result-site looks like the following code. (This code works with PHP). But in my specific case I can´t use PHP. I have to do it with Java Script and plain HTML.

How can I do this with Java Script / without PHP? Is it possible? How to read the URI querry and attach it to the new iframe source link?

  1. <html>
  2. <body>
  3. <?
  4. $params="";
  5. foreach($_POST as $name=>$value)
  6. {
  7. //we propagate all parameters to the search results except the controller page parameter
  8. if ($name!="controllerPage")
  9. {
  10. $params=$params.$name."=".$value."&";
  11. }
  12. }
  13. ?>
  14. <h1>This is a result page</h1>
  15. <iframe name=""
  16. src="http://www.fakewebshop.com/result.html?<? echo $params; ?>"
  17. width="600" height="1070" scrolling="auto" align="top" frameborder="0">
  18. </iframe>
  19. </body>
  20. </html>