| | |
Resize External Url In I-frame
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Mar 2008
Posts: 36
Reputation:
Solved Threads: 0
Hello, I need to resize an I-fame according to the height of an external page. I have found some google code that does what I need but it is way bloated. Anyone how to do what this code does but with less bloat? Thanks in Advance!
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
( function(){ var e=null,a=window,l="sitesearch",r=a.googleSearchResizeIframe||a.googleSearchPath&&a.googleSearchPath=="/cse"&&typeof a.googleSearchResizeIframe=="undefined",p,n,i;function s(c,b,j,m){ var f={},g=c.split(j);for(var d=0;d<g.length;d++){ var h=g[d],o=h.indexOf(b);if(o>0){ var k=h.substring(0,o);k=m?k.toUpperCase():k.toLowerCase();var u=h.substring(o+1,h.length);f[k]=u}}return f}function v(){ var c=document.location.search;if(c.length<1)return"";c=c.substring(1,c.length);var b=s(c,"=","&", false);if(a.googleSearchQueryString!="e"&&b[a.googleSearchQueryString]){ b.q=b[a.googleSearchQueryString];delete b[a.googleSearchQueryString]}if(b.cof){ var j=s(decodeURIComponent(b.cof),"-",";",true),m=j.FORID;if(m)p=parseInt(m,10)} var f=document.getElementById(a.googleSearchFormName); if(f){if(f.q&&b.q&&(!b.ie||b.ie.toLowerCase()=="utf-8"))f.q.value=decodeURIComponent(b.q.replace(/\+/g," ")); if(f[l])for(var g=0;g<f[l].length;g++)f[l][g].checked=b[l]==e&&f[l][g].value==""?true:f[l][g].value==b[l]?true:false}var d=""; for(var h in b)d+="&"+h+"="+b[h];return d.substring(1,d.length)}function q(c,b){return b?"&"+c+"="+encodeURIComponent(b):""}function t(c,b){return c?Math.max(c,b):b}function w(){ var c="http://";c+=a.googleSearchDomain?a.googleSearchDomain:"";c+=a.googleSearchPath?a.googleSearchPath:"";c+="?"; if(a.googleSearchQueryString)a.googleSearchQueryString=a.googleSearchQueryString.toLowerCase();c+=v();c+=q("ad","w"+n);c+=q("num",i);c+="&submit=search";if(r){ var b= a.location.href,j=b.indexOf("#");if(j!=-1)b=b.substring(0,j);c+=q("rurl",b)}return c}function x(){ //n=a.googleSearchNumAds;n||(n=9); i=a.googleNumSearchResults;i=i?Math.min(i,20):10; var c={};c[5]=795;c[10]=795;c[11]=500; var b={}; b[5]=300+90*i;b[10]=300+50*Math.min(n,4)+90*i;b[11]=300+50*n+90*i; //b[5] = 390+90*i; var j=w();if(!a.googleSearchFrameborder)a.googleSearchFrameborder="0"; var m=document.getElementById(a.googleSearchIframeName);if(m&&c[p]){ var f=t(a.googleSearchFrameWidth,c[p]),g=t(a.googleSearchFrameHeight,b[p]), d=document.createElement("iframe"),h={ name:"googleSearchFrame",src:j,frameBorder:a.googleSearchFrameborder,width:f,height:g,marginWidth:"0",marginHeight:"0",hspace:"0",vspace:"0",allowTransparency:"true",scrolling:"no"};for(var o in h)d.setAttribute(o,h[o]);m.appendChild(d);d.attachEvent?d.attachEvent("onload", function(){ window.scrollTo(0,0)}):d.addEventListener("load",function(){ window.scrollTo(0,0)},false);r&&a.setInterval( function(){ if(a.location.hash&&a.location.hash!="#"){ var k=a.location.hash.substring(1)+"px"; if(d.height!=k&&k!="0px")d.height=k}},10)}a.googleSearchIframeName=e;a.googleSearchFormName=e;a.googleSearchResizeIframe=e;a.googleSearchQueryString=e;a.googleSearchDomain=e;a.googleSearchPath=e;a.googleSearchFrameborder=e;a.googleSearchFrameWidth=e;a.googleSearchFrameHeight=e;a.googleNumSearchResults=e;a.googleAdtest=e}x() })();
![]() |
Similar Threads
- Firefox Compatibility help with script (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Problem related to JSP and Javascript
- Next Thread: Do you know google ads on flash script?
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate array automatically beta box bug calendar cart checkbox class codes column createrange() css cursor date debugger decimal design dom download dropdown element embed enter error explorer firefox focus form frameworks getselection google gwt hiddenvalue hint html htmlform ie7 iframe images index internet java javascript javascripthelp2020 jawascriptruntimeerror jquery jsf jsfile jsp libcurl listbox maps masterpage media menu microsoft mimic mp4 object onmouseover paypal php player position post problem programming progressbar prototype redirect regex runtime safari scale scriptlets search security select shopping size software sql text textarea toggle unicode w3c website window windowofwords windowsxp wysiwyg





