Page 1 of 1

Can't get data from internet

Posted: Sat Mar 04, 2017 2:37 pm
by tomsve
Hi again,

Maybe I just forgot something here, but I simply can't get data from internet to my field.

I have a button on my card. The code for my button;

Code: Select all

on mouseUp
   load URL "host/someText.html" with message "doneLoading"
end mouseUp
The code in my card. I moved the code to the stack code as well, without success.

Code: Select all

on doneLoading
  answer "The URL is finished downloading."
end doneLoading
^^ never runs.


I've been trying to output the result into a field called "content" as well, with this code:

Code: Select all

put URL "host" into field "content"
It worked once, and I got some cryptic message in field "content" with "success" in the beginning. But after that one time - nothing.

"host" here is the whole url of course, but I'm not allowed to post URLs here in the forum it seems, not even to example. com


Any ideas of what I am doing wrong here?

Re: Can't get data from internet

Posted: Sat Mar 04, 2017 4:36 pm
by Klaus
Hi Tom,

what platform and what version of LC?
SHOULD work out of the box of course!

You need to have at least 10 postings before you can post URLs and attachments here.
This is due to high spam traffic here unfortunately.


Best

Klaus

Re: Can't get data from internet

Posted: Sat Mar 04, 2017 5:32 pm
by tomsve
Dear Klaus,

Thanks for answering. Yes, I also expected it to work out of the box.

I'm using LiveCode 8.1.3 with xCode 8.2.1.

Btw, I managed to attach a file in my previous post regarding to get the scroller to work with data grid in iOS. That was my 3rd post I think, so I'm happy :)

Re: Can't get data from internet

Posted: Sat Mar 04, 2017 5:38 pm
by Klaus
Hi Tom,

hm, very strange...

Try this:

Code: Select all

...
put URL "www.host..." into field "content"
if the result <> empty then 
   answer the result
end if
...
Maybe that ("the result" is empty on success!) will give us a little hint on what might go wrong.


Best

Klaus

Re: Can't get data from internet

Posted: Sat Mar 04, 2017 5:50 pm
by tomsve
I get a message box saying "error URL is currently loading". Any ideas...?

Re: Can't get data from internet

Posted: Sat Mar 04, 2017 6:00 pm
by tomsve
I just had a quick look in the release notes to see if there was any known issues related to internet with the release I use, but I couldn't find any. Instead, it's written "LiveCode Indy and Business editions now come with the tsNet external, which supercharges LiveCode's Internet features and performance. ".

Is there something I should do with my code to use tsNet maybe, to get it to work?

Re: Can't get data from internet

Posted: Sat Mar 04, 2017 6:13 pm
by Klaus
Hi Tom,

no need to change your code, tsNet will automatically be used in the Indy and Business edition.
For the "error URL is currently loading", is this just a "small" HTML page that you try to load or some "bigger" file?

Whatever, try again after quitting and restarting LC.


Best

Klaus