List internet search

This forum contains topics that were moved from Get Satisfaction
MRcanadafaf
Posts: 0
Joined: Sun Jun 15, 2014 3:13 am

List internet search

Post by MRcanadafaf »

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

Post by Alena Prykhodko »

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

Post by MRcanadafaf »

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

Post by Alena Prykhodko »

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

Post by MRcanadafaf »

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

Post by Alena Prykhodko »

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

Post by EJLD »

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

Post by Evgene Karachevtsev »

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

Post by EJLD »

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

Post by Yurii Orishchuk »

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.

Post Reply