Page 1 of 1

Set document title

Posted: Sun Feb 07, 2016 9:51 am
by sworteu
To set the document title:

Code: Select all

EnableJS
document.title = "My title"
DisableJS
I've put this in a external file, where i have all my javascript.
Then just include it at the beginning using XIncludeFile "myfile.sb"
I hope anyone finds it usefull.

Re: Set document title

Posted: Mon Feb 08, 2016 9:27 am
by SparrowhawkMMU
+1 many thanks

Re: Set document title

Posted: Mon Feb 08, 2016 1:35 pm
by sworteu
SparrowhawkMMU wrote:+1 many thanks
If you need more tricks let me know. Pb and js are languages i know well.

Re: Set document title

Posted: Wed Jun 29, 2016 12:16 pm
by hotcore
Is something like this possible:

File "title.sb"

Code: Select all

EnableJS
document.title = myTitle
DisableJS
In some other source:

Code: Select all

myTitle = "My nice project"
xincludefile "title.sb"

Re: Set document title

Posted: Wed Jun 29, 2016 12:23 pm
by hotcore
Found it; use:

Code: Select all

EnableJS
document.title = v_myTitle
DisableJS

Re: Set document title

Posted: Wed Jun 29, 2016 3:08 pm
by SparrowhawkMMU
I think it needs to be "v_mytitle" i.e. all lower case.

Re: Set document title

Posted: Wed Jun 29, 2016 3:24 pm
by hotcore
Thx. Had it working already (with lowercase name ;-)