Remember me? forgot password | register

SilverStripe Forum

3818 Posts in 841 Topics by 527 members

Jump to:

Extending and hacking

If this is your first visit, you will need to register before you can post. However, you can browse all messages below.

Community » SilverStripe Forum » Extending and hacking » Extended iFrames
Page: 1 go to end Reply
Author Topic: Extended iFrames 137 views
  • snyhof
    avatar
    Community Member
    20 posts
    4 SilverStripe Sites

    Extended iFrames Link to this post

    Some of my iframes include a script...

    How can I add this to the iframes module, or is there another way? Without this ability, I can't use SilverStripe - and so far I really like it. Any help?
    Thank you,
    Steve

    <IFRAME title="Search house plans and home plans" id=myFrame frameBorder=0 width=100% height=2000></IFRAME>
    <script>
    function decodeQuery(query)
    {
    var params = {}; // prepare the map
    if (query.length < 2) // zero characters or single '?' means no parameters
    return params;
    // cut '?' away:
    query = query.slice(1);
    var paramList=query.split('&'); // separate parameters
    for(var i=0; i<paramList.length; i++) // enumerate them
    {
    var pair = paramList.split('=');
    params[pair[0]]=pair[1];
    }
    return params;
    }

    var query=location.search; // get everything after question mark
    var params = decodeQuery(query); // and turn into an indexable structure
    var p = (params.id) // checking if 'id' is present
    ? '&action=more_details&id=' + params.id // if present, then ask for more details
    : ''; // otherwise - don't.
    var iframe = document.getElementById('myFrame');

    iframe.src="http://www.sneserver.com/houseplans/index.php?BuilderID=197" + p;
    </script>

    137 views
go to top Reply

Currently Online:

CriaturaCreativaStudio, SmartPlugs Design, SiSt, kickme

Welcome to our latest member: Anonymous user