MRcanadafaf
Posts: 0
Joined: Sun Jun 15, 2014 3:13 am

List internet search

Hi,

I created a list for my app and when I click on a word/phrase in my list I would like for it to search google or a similar website for that keyword. I'm trying to do it through "navigate to link" but I can't seem to get it to work. Any suggestions?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

List internet search

Hi,

Could you please clearify, do you want to navigate to search website but input keyword from your app?
Please post what exactly you have tried.

MRcanadafaf
Posts: 0
Joined: Sun Jun 15, 2014 3:13 am

List internet search

I would like to search a website like google with a keyword from my app (the keyword is in a list)

I've tried doing like this, but it only opens google and doesn't search for the keyword.

Image

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

List internet search

If you do like this, it just navigates you to google.com website.
Please read more here http://stackoverflow.com/questions/17... or you can look for workarounds online.

MRcanadafaf
Posts: 0
Joined: Sun Jun 15, 2014 3:13 am

List internet search

This does not help me.

I'm looking through the source code and can't find where I need to put some of the code where it's asked me to.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

List internet search

Hello,

On Click event run the following code:

pre
var value = $(this).text();
var res = encodeURIComponent(value);
var link = "http://www.google.com/search?q=" + res;
window.open(link, '_system');
/pre

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

List internet search

Hi there, this was helpful to me thks.
it works well when searching a single word "Soccer".
however, with a string of several words "Soccer World Cup", it ignores that string and opens the google landing page only, no search has been performed.
I tried several things, including replacing white spaces by '+' sign as in the search URL retreated ... nothing works so far.
wld has anybody (Appery or participants of this forum) found the tric ?
thks a lot in advance
Eric

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

List internet search

Hello Eric,

Could you please check what value is written in a variable res?

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

List internet search

Hi Evgene, thks for looking at it.
here you are

selectedTxt =Soccer World Cup
res =Soccer%20World%20Cup
link = https://www.google.co.jp/search?q=Soc...

works perfect with single word but nothing with a string a several :(

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

List internet search

Hi EJLD,

I tried following code with static search string with space and it works correctly:

pre

var value = "hello world";
var res = encodeURIComponent(value);
var link = "http://www.google.com/search?q=" + res;
window.open(link, '_system');

/pre

Regards.

Return to “Issues”