Launch url not workin?

Bringing your stacks to the web

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
libuda
Posts: 5
Joined: Thu May 13, 2021 6:42 pm

Launch url not workin?

Post by libuda » Thu May 13, 2021 6:48 pm

Hi everybody,
i try to open an website over a button with this script:
on mouseup
launch url "someurl"
end mouseup
But this doesn´t work in a standalone HTML5 app?
what is my error??

Thanks for some newbi help

Klaus
Posts: 12358
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Launch url not workin?

Post by Klaus » Thu May 13, 2021 7:03 pm

Hi libuda,

welcome to the forum!

You are doning nothing wrong, -> launch url "someurl" is not supported in HTML5.
If in doubt, check the Dictionary, all supported platforms for a command/function are listed.


Best

Klaus

libuda
Posts: 5
Joined: Thu May 13, 2021 6:42 pm

Re: Launch url not workin?

Post by libuda » Thu May 13, 2021 7:13 pm

Hi Klaus,
thnaks for the answer.
Do you know an easy way to open a website over an button in an HTML5-app?

Klaus
Posts: 12358
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Launch url not workin?

Post by Klaus » Thu May 13, 2021 8:24 pm

Hi libuda,

sorry, no idea...


Best

Klaus

libuda
Posts: 5
Joined: Thu May 13, 2021 6:42 pm

Re: Launch url not workin?

Post by libuda » Fri May 14, 2021 12:18 pm

Hi everybody,
instead of launch url i try to use a javascript on the HTML-page to open the webpage for me.
So i try
do "pagejump (myurl);" in browser
in livecode.

And on the HTML-Page:
function pagejump (myparam) {
a window open statement
}

But it doesn´t work too. Anyone any idea???

libuda
Posts: 5
Joined: Thu May 13, 2021 6:42 pm

Re: Launch url not workin?

Post by libuda » Fri May 14, 2021 12:57 pm

So finally i get it to work:
Here is the solution:
In Livecode you can use:
do "jumpurl(targeturl);" as "JavaScript"

and on the embedding website:
<script type="text/javascript">
function jumpurl(target) {
an here use: window open with the target
}
</script>

or you do this in livecode direct. Without embeded javascript on the website:
put "window open('" & targeturl & "', '_blank')" into tScript
do tScript as "JavaScript"

Post Reply

Return to “HTML5”