Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Code Projet !

I would like to have :
- a page A with several links to different playlists
- a page B with an iframe to load the selected playlist

So far, I have this page B :
http://sg-cms.azurewebsites.net/opespe/travel2/boarding.php?id=summer-1

That should load this page in the iframe : http://soundsgoood.com/playlist/summer-1

But I can't get the ?id=summer-1 to change the iframe source accordingly.

Here is the page B code :

<html>
    <head>
    </head>
    <body> 
        <div id="header">
            <a href="index.html">Back</a>
        </div>

        <iframe id="myIframe" src="http://soundsgoood.com/playlist/" style="width:100%; height:1000px;"></iframe>

        <script>
        (function() {
            var frameBaseSRC = document.getElementById("myIframe").src;
            var frameQueryString = document.location.href.split("id=")[1];
            if (frameQueryString != undefined) {
                document.getElementById("myIframe").src = frameBaseSRC + "?id=" + frameQueryString;
            }
         })();
         </script>
    </body>
</html>


What do I miss here ? (I'm a novice, srory ^^).

L.
Posted

1 solution

why dont you replace de iframe for another way like Web Parts, ContentPlaceHolder etc? with this you have more control and accessibility on your source code.

iFrames isn't secure and many firewalls block iframes

Regards
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900