dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Calling JS generated URL within an iFrame

  1. #1
    Join Date
    Oct 2010
    Posts
    2

    Thumbs up Calling JS generated URL within an iFrame

    Hi

    I've got the following javascript, which loads the site primarypad.com with a random string after a forward slash (eg http://primarypad.com/civ8192573 )


    <script language="javascript" type="text/javascript">
    function createPPWorkspace()
    {
    var PPbaseURL = "http://www.primarypad.com";
    var Stamp = new Date();
    var PPrandomSuffix = '/civ' + Stamp.getUTCMilliseconds() + parseInt(Stamp.getMilliseconds() * 3.142);
    var PPNewURL = PPbaseURL + PPrandomSuffix;
    PPWindow = window.open(PPNewURL,'_PrimaryPad');
    }
    </script>
    <iframe src="button" value="Create a new Primary Pad workspace" onclick="createPPWorkspace();" />

    At the moment, this presents a button which opens this URL in a new window. But I'd like to instead load this JS generated URL in an iFrame. I figure I need to stick something after the iframe src= that calls on the output of the javascript, but I can't figure out how to do it.

    Any help would be really appreciated!

  2. #2
    Join Date
    Oct 2010
    Posts
    2
    Should clarify, as I might not have made it completely clear what I want it to do.

    I want to package both of these together in a web page, so each time it's loaded, it automatically loads the generated page within an iframe. I don't want the user to have to click anything - just load the page

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles