Using Java Script

Questions and answers about anything related to Helium Scraper
Post Reply
Christos
Posts: 9
Joined: Tue Apr 24, 2012 10:07 am

Using Java Script

Post by Christos » Wed Jun 13, 2012 4:01 pm

I am new to Java, I try to read from a table called Input and write in Input fields, Table has 2 columns -
Topic & Description

Java Script-1
Read Database

Code: Select all

if(Global.UserData == undefined) 
{
	Global.UserData = Global.DataBase.Query("Select * FROM Input")
}
if(Global.UserData.Read()) return true;
else return false;
Writing from 1st Row For Topic

Code: Select all

Global.Browser.Selection.GetItem(0).value = Global.UserData.GetValue(0);
Writing from 2nd Row For Description

Code: Select all

Global.Browser.Selection.GetItem(1).value = Global.UserData.GetValue(1);
But it is not working, What can I do to make it work?
Attachments
posting.zip
file using above code can be seen here!
(33.5 KiB) Downloaded 578 times

webmaster
Site Admin
Posts: 521
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Re: Using Java Script

Post by webmaster » Thu Jun 14, 2012 2:00 am

Try replacing

Code: Select all

Global.UserData = Global.DataBase.Query("Select * FROM Input")
for

Code: Select all

Global.UserData = Global.DataBase.Query("Select * FROM [Input]")
Since Input is a keyword you need to use brackets. If you look at the log (Project -> View Log) you'll see this code is throwing an error.

Let me know if there are any other doubts.
Juan Soldi
The Helium Scraper Team

Post Reply