Greeting and Thanks up front.

I am having difficulty moving data from a javascript call to GoogleSearch back 
to the CF page where I want to display it...
the Old SOAP code was like this and relativity straight forward:
                <cfinvoke 
                webservice="http://www.renovation-supply.us/GoogleSearch.txt"; 
                method="doGoogleSearch" 
                key="OUR KEY WAS CLIPPED" 
                q='site:www.rensup.com/ description. "#ForceKeyword#" .htm' 
                start="0" 
                maxResults="10" 
                filter="0" 
                restrict="0" 
                safeSearch="1" 
                lr="" 
                ie="latin1" 
                oe="latin1" 
                returnVariable="resultset"> 
                </cfinvoke> 

<cfif Val(resultset.startindex)> 
        <table width="100%" cellspacing="0" cellpadding="5" border="0"> 
        <cfloop from="#resultset.startindex#" to="#resultset.endindex#" 
index="i"> 
                        THEN BEGINS THE PARSING FOR DISPLAY OF THE RESULTSET 

The new code that I'm trying to work out is as follows:

<script 
src="http://www.google.com/uds/api?file=uds.js&amp;v=1.0&amp;key=ABQIAAAA4Js6nqyzIBFHfVbFYpKdeRRvRuxe2IyBY38ekLKLt2x2yeJ63xTA3eqhu8C2QGPaimYBTD8bDLxPgQ";
 type="text/javascript"></script>    
<script language="Javascript" type="text/javascript">    

//<![CDATA[
    function GetResults() {
        //Create a gsearch object
        var SiteSearch = new GwebSearch();
        var CurrentResults = [];
        SiteSearch.setSiteRestriction("www.rensup.com");
        SiteSearch.setResultSetSize(GSearch.LARGE_RESULTSET);
        SiteSearch.EXPAND_MODE_OPEN;
        SiteSearch.execute("description. ""Glass Sinks"" .htm");
        SiteSearch.setSearchCompleteCallback(null, searchComplete, [null]); 
        }

   function searchComplete() { 
      if (SiteSearch.results && SiteSearch.results.length) { 
        var i; 
        for (i=0; i < SiteSearch.results.length; i++ ) { 
          var result = SiteSearch.results[i]; 
      } 
    } 
}

BUT HERE IS THE PROBLEM: (a)How do I get the whole array back to CF so that
the following can be used:

<cfset resultset = "GetResults();">
<cfif Val(resultset.length)>

<table width="100%" cellspacing="0" cellpadding="5" border="0">
<cfloop from="#resultset.startindex#" to="#resultset.endindex#" index="i">

I'm currently getting an error: You have attempted to dereference a scalar 
variable of type class java.lang.String as a structure with members.

I'm not sure how WDDX would fit here or even if it's needed, seems like I need 
to 
declare an array structure for the data the googlesearch returns and then pass 
that array to the resultset and then continue processing. What Am I missing?

JP

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2393
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to