User Tools

Site Tools


Sidebar

Passage markup

basics

coding

extra

list

section

whitespace

Macros

basics

colour

data structure

date and time

game state

live

maths

number

revision

saving

showing and hiding

string

styling

url

deprecated

Types of data

Special keywords

Special passage tags

harlowe:goto-url

(goto-url: String) → Command

When this command is used, the player's browser will immediately attempt to leave the story's page, and navigate to the given URL in the same tab. If this succeeds, then the story session will “end”.

Example usage:

(goto-url: "http://www.example.org/")

Details:

If the given URL is invalid, no error will be reported - the browser will simply attempt to open it anyway.

Much like the <a> HTML element, the URL is treated as a relative URL if it doesn't start with “http:”, “https:”, or another such protocol. This means that if your story file is hosted at “http://www.example.org/story.html”, then (open-url: "page2.html") will actually open the URLhttp://www.example.org/page2.html”.

See also:

harlowe/goto-url.txt · Last modified: 2017/10/10 00:39 (external edit)