// Keep track of the iframe height. var if_height,
// Pass the parent page URL into the Iframe in a meaningful way (this URL could be // passed via query string or hard coded into the child page, it depends on your needs). src = 'http://{umbraco.library:Replace(umbraco.library:RequestServerVariables("SERVER_NAME"),".azbar.",".myazbar.")}/{$iframeSource}?{$qryString}#' + encodeURIComponent(document.location.href), // Append the Iframe into the DOM. iframe = $('<iframe src="' + src + '" width="100%" height="600" frameborder="0" scrolling="no" allowtransparency="yes" marginheight="0" marginwidth="0"></iframe>') .appendTo('#iframe'); // Setup a callback to handle the dispatched MessageEvent event. In cases where // window.postMessage is supported, the passed event will have .data, .origin and // .source properties. Otherwise, this will only have the .data property. $.receiveMessage(function(e){ // Get the height from the passsed data. var h = Number(e.data.replace(/.*if_height=(\d+)(?:&|$)/,'$1')); if ( !isNaN( h ) && h > 0 && h !== if_height ) { // Height has changed, update the iframe. iframe.height( if_height = h ); } // An optional origin URL (Ignored where window.postMessage is unsupported). }, 'http://www.azbar.dev' ); }); }); </script> </xsl:template>
Ok, one step closer. I figure out the error above. Now, I need to figure out how to get the XSLT to pass my server variables inside the script.
<script type="text/javascript"> $(function(){
// Keep track of the iframe height. var if_height,
// Pass the parent page URL into the Iframe in a meaningful way (this URL could be // passed via query string or hard coded into the child page, it depends on your needs). src = 'http://www.myazbar.dev/Preferences/personalpreferences1.cfm#' + encodeURIComponent( document.location.href ), // Append the Iframe into the DOM. iframe = $('<iframe src="' + src + '" width="100%" frameborder="0" scrolling="no" allowtransparency="yes" marginheight="0" marginwidth="0"></iframe>') .appendTo('#iframe'); // Setup a callback to handle the dispatched MessageEvent event. In cases where // window.postMessage is supported, the passed event will have .data, .origin and // .source properties. Otherwise, this will only have the .data property. $.receiveMessage(function(e){ // Get the height from the passsed data. var h = Number(e.data.replace(/.*if_height=(\d+)(?:&|$)/,'$1')); if ( !isNaN( h ) && h > 0 && h !== if_height ) { // Height has changed, update the iframe. iframe.height( if_height = h ); } // An optional origin URL (Ignored where window.postMessage is unsupported). }, 'http://{umbraco.library:Replace(umbraco.library:RequestServerVariables("SERVER_NAME"),".azbar.",".myazbar.")}' ); }); </script>
Cross Domain iFrame Height in XSLT
I'm trying to use the cross domain iframe height example here: http://css-tricks.com/cross-domain-iframe-resizing/
I can't get my XSLT to save without error. Right now, I get "An error occurred while parsing EntityName. Line 45, position 61."
My XSLT is below:
Ok, one step closer. I figure out the error above. Now, I need to figure out how to get the XSLT to pass my server variables inside the script.
is working on a reply...