PDA

View Full Version : Error implementing Google CSE within app



mobitinker
11 Jul 2011, 3:06 PM
Having trouble getting my head around this one.

I have the following code in a tab panel that executes a Google Custom Search with no problems when I run it from a localhost domain on my development machine (/mylocaldomain/index.html).



listeners : {
beforeRender: function (){

google.setOnLoadCallback(function(){
//TODO make constant
console.log("setonload");
var cse = new google.search.CustomSearchControl('007447616601297022092:7nhsxzpy6ao');
cse.draw('cse');
}, true);

}

}

When searching, the results come up within the tabpanel just as desired. But when I run it on device within a PhoneGap application, I get the error after pressing the search button:

Application Error


The requested file was not found. /www.google.com/cse (No such file or directory) (file://www.google.com/cse?q=...

I think the Google JS is getting confused and trying to send the request to the local file system on the device since that is where the app is running from.

I was thinking I could dynamically change the form action to go to http://google.com/cse but I can not see where it is within Firebug. Probably due to my newness.