Set Iframe Source on Remote Page via URL Parameter


Staff member
I have 3 pages that I am working with.


This page retrieves product data from MySQL db and lists formats it. It accepts the url parameters brand=BRANDNAME and cat=CATEGORY.

Here are two examples of this page in action:<br>
<a href=";cat=KYMCO Scooters" rel="nofollow noreferrer">;cat=KYMCO Scooters</a>

<a href=";cat=Peace Sports Scooter" rel="nofollow noreferrer">;cat=Peace Sports Scooter</a>


This page contains links to view specific product listings pages (i.e. "KYMCO Scooters", "Peace Sports Scooters"). When these links are clicked, they should all take the user to the same page (view.html) but pass URL parameters which tell the Iframe within view.html which url to use as its source.


This page contains an Iframe which gets its source from the URL parameters passed by the links from vehicles.html


I tried using the solution provided at <a href="">How do I pass URL parameter to an iFrame in Wordpress page?</a> to solve my problem, but I have never used jquery before and I was not able to get it working correctly.

Any help would be greatly appreciated.

<strong><em>More Info</em></strong>

Sample of a link from Vehicles.html

&lt;a href="view.html?;cat=KYMCO%20Scooters"&gt;KYMCO Scooters&lt;/a&gt;

What I think View.html should do:

<li>Extract "<a href=";cat=KYMCO Scooters" rel="nofollow noreferrer">;cat=KYMCO Scooters</a>" from the url "view.html?<a href=";cat=KYMCO Scooters" rel="nofollow noreferrer">;cat=KYMCO Scooters</a>" and store it as a variable called $embedLink. </li>
<li>Display an Iframe with $embedLink as its source url.</li>