(iTD) Posted July 16, 2012 Share Posted July 16, 2012 I am running a Joomla 2.5 website plus WHMCS 5. I have seen many questions out here regarding what I am about to ask, but this is a slightly different issue that has not been addressed. Using the WHMCS "classic" template, I am making alterations to "header.tpl" by placing a javascript in the <head> section to check if WHMCS is in an iFrame. If not, then redirect users to the Joomla page that contains the iFrame with WHMCS inside of it. Simple enough. However, it does not appear that the script is executing. Is there a setting in WHMCS to allow javascript to run from a template? I tested this script in a plain HTML file and it worked perfectly. Here's the script that I placed in the <head> of header.tpl: <script type="text/javascript"> if (window == top) { var querystring = top.location.search.substring(1); // gets everything after the ? in the URL var newtop = "http://mysite.com/joomla-page"; // the site is not live and I don't want to post the url here. location.replace( newtop + "&" + querystring ); } </script> Any help would be appreciated. PLEASE - if you don't agree with the use of iFrames then please DO NOT comment on this post. I need help, not design opinions ... 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.