[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

11/03/2009 at 01:32PM PST, ID: 24868979
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.3

modifying google search results iframe

Asked by salemglobal in Search Engines, JScript

Tags: google custom search, javascript, iframe

Hi -- this is probably going to be a tough question, but I've got a custom google search box redirecting search results to an existing webpage on my site.  You can see the search box in the upper right hand corner of this page, http://www.chryslerbrooklyn.com/. If you type in "mold," you'll see the results are directed to a pre-existing php page (gmisearch.php), and the search results are held in an iframe generated by javascript.

This is the code I've put on the php page (gmisearch.php) to display the search results:


<script type="text/javascript">
  var googleSearchIframeName = "cse-search-results";
  var googleSearchFormName = "cse-search-box";
  var googleSearchDomain = "www.google.com";
  var googleSearchPath = "/cse";
</script>
<script type="text/javascript">
(function(){var e=null,b=window,o=b.googleSearchResizeIframe||b.googleSearchPath&&b.googleSearchPath=="/cse"&&typeof b.googleSearchResizeIframe=="undefined",l,k,h;function p(a,c,d,i){var f={};a=a.split(d);for(d=0;d<a.length;d++){var g=a[d],j=g.indexOf(c);if(j>0){var m=g.substring(0,j);m=i?m.toUpperCase():m.toLowerCase();g=g.substring(j+1,g.length);f[m]=g}}return f}function r(){var a=document.location.search;if(a.length<1)return"";a=a.substring(1,a.length);a=p(a,"=","&",false);if(b.googleSearchQueryString!=
"q"&&a[b.googleSearchQueryString]){a.q=a[b.googleSearchQueryString];delete a[b.googleSearchQueryString]}if(a.cof){var c=p(decodeURIComponent(a.cof),":",";",true);if(c=c.FORID)l=parseInt(c,10)}if(c=document.getElementById(b.googleSearchFormName)){if(c.q&&a.q&&(!a.ie||a.ie.toLowerCase()=="utf-8"))c.q.value=decodeURIComponent(a.q.replace(/\+/g," "));if(c.sitesearch)for(var d=0;d<c.sitesearch.length;d++)c.sitesearch[d].checked=a.sitesearch==e&&c.sitesearch[d].value==""?true:c.sitesearch[d].value==a.sitesearch?
true:false}c="";for(var i in a)c+="&"+i+"="+a[i];return c.substring(1,c.length)}function n(a,c){return c?"&"+a+"="+encodeURIComponent(c):""}function q(a,c){return a?Math.max(a,c):c}function s(){var a="http://";a+=b.googleSearchDomain?b.googleSearchDomain:"www.google.com";a+=b.googleSearchPath?b.googleSearchPath:"/custom";a+="?";if(b.googleSearchQueryString)b.googleSearchQueryString=b.googleSearchQueryString.toLowerCase();a+=r();a+=n("ad","w"+k);a+=n("num",h);a+=n("adtest",b.googleAdtest);if(o){var c=
b.location.href,d=c.indexOf("#");if(d!=-1)c=c.substring(0,d);a+=n("rurl",c)}return a}function t(){(k=b.googleSearchNumAds)||(k=9);h=(h=b.googleNumSearchResults)?Math.min(h,20):10;var a={};a[9]=795;a[10]=395;a[11]=500;var c={};c[9]=300+90*h;c[10]=300+50*Math.min(k,4)+90*h;c[11]=300+50*k+90*h;var d=s();if(!b.googleSearchFrameborder)b.googleSearchFrameborder="0";var i=document.getElementById(b.googleSearchIframeName);if(i&&a[l]){a=q(b.googleSearchFrameWidth,a[l]);c=q(b.googleSearchFrameHeight,c[l]);
var f=document.createElement("iframe");d={name:"googleSearchFrame",src:d,frameBorder:b.googleSearchFrameborder,width:a,height:c,marginWidth:"0",marginHeight:"0",hspace:"0",vspace:"0",allowTransparency:"true",scrolling:"no"};for(var g in d)f.setAttribute(g,d[g]);i.appendChild(f);f.attachEvent?f.attachEvent("onload",function(){window.scrollTo(0,0)}):f.addEventListener("load",function(){window.scrollTo(0,0)},false);o&&b.setInterval(function(){if(b.location.hash&&b.location.hash!="#"){var j=b.location.hash.substring(1)+
"px";if(f.height!=j&&j!="0px")f.height=j}},10)}b.googleSearchIframeName=e;b.googleSearchFormName=e;b.googleSearchResizeIframe=e;b.googleSearchQueryString=e;b.googleSearchDomain=e;b.googleSearchPath=e;b.googleSearchFrameborder=e;b.googleSearchFrameWidth=e;b.googleSearchFrameHeight=e;b.googleSearchNumAds=e;b.googleNumSearchResults=e;b.googleAdtest=e}t()})();

</script>

My question: how do I modify the javascript to reposition the iframe to the RIGHT side of the page. Currently it is displaying search results on the left side.
[+][-]11/03/09 01:43 PM, ID: 25734133

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Search Engines, JScript
Tags: google custom search, javascript, iframe
Sign Up Now!
Solution Provided By: HainKurt
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20090824-EE-VQP-74 - Hierarchy / EE_QW_3_20080625