Page 1 of 2
List internet search
Posted: Sun Jun 15, 2014 3:35 am
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?
List internet search
Posted: Sun Jun 15, 2014 4:07 am
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.
List internet search
Posted: Sun Jun 15, 2014 4:09 am
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.
List internet search
Posted: Sun Jun 15, 2014 4:24 am
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.
List internet search
Posted: Sun Jun 15, 2014 5:18 am
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.
List internet search
Posted: Tue Jun 17, 2014 2:42 am
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
List internet search
Posted: Sun Jun 14, 2015 12:34 am
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
List internet search
Posted: Sun Jun 14, 2015 3:36 pm
by Evgene Karachevtsev
Hello Eric,
Could you please check what value is written in a variable res?
List internet search
Posted: Sun Jun 14, 2015 11:25 pm
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
List internet search
Posted: Tue Jun 16, 2015 3:18 am
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.