Jump to content

JS Function causing Iframe deployment to show up below footer of website.


Recommended Posts

I have a page Shown Here that has a couple of datapages deployed as Iframes. My table at the bottom has a custom script which is also shown below. As you can see, this is causing the iframe to show below the footer of the website and not where originally specified. When I take away the javascript and just use the iframe deploy code, it works correctly.

Does anyone know why it might be showing up so low in the website?

 

<noscript><iframe border="0" frameborder="0" height="1000px" marginheight="0" marginwidth="0" name="iframe" src="https://c1abv844.caspio.com/dp/91cf7000e1c04a6858f7405d90f8" width="100%">Your browser does not support inline frames or is currently configured not to display inline frames.</iframe></noscript><script type="text/javascript">
        var form = 'https://c1abv844.caspio.com/dp/91cf7000e1c04a6858f7405d90f8';
        var params = window.location.search;
        var thisScript = document.scripts[document.scripts.length - 1];
        var iframe = document.createElement('iframe'); 
        iframe.setAttribute('src', form + params);
        iframe.setAttribute('width', '100%');
        iframe.setAttribute('height', 500);
        iframe.setAttribute('type', 'text/html');
        iframe.setAttribute('frameborder', 0);
        iframe.setAttribute('allowTransparency', 'true');
        iframe.style.border = '0'; 
        thisScript.parentElement.replaceChild(iframe, thisScript);
        </script>
Link to comment
Share on other sites

I tried taking out the noscript, and it works to put the original Iframe in the correct spot, but the reason for the javascript in the first place is to grab the parameter from the URL and send to the iframe. The iframe with the noscript does not receive this parameter, but the iframe below my footer does receive it correctly.

Link to comment
Share on other sites

Hi @rgiljohann,

There is an easier way how you can pass a parameter from URL to an Iframe.

You can simple paste the parameter into Iframe src e.g. 

<iframe src="URL?HHAIPName=[@HHAIPName]" width="100%" height="1000" type="text/html" frameborder="0" style="border: 0">

This should help you to remove your JS code and <noscript> tags.

Regards,

Vitalikssssss

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...