Share your advanced knowledge/code with the community.
sworteu
Posts: 18 Joined: Sun Feb 07, 2016 9:49 am
Post
by sworteu » Sun Feb 07, 2016 9:51 am
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.
sworteu
Posts: 18 Joined: Sun Feb 07, 2016 9:49 am
Post
by sworteu » Mon Feb 08, 2016 1:35 pm
SparrowhawkMMU wrote: +1 many thanks
If you need more tricks let me know. Pb and js are languages i know well.
hotcore
Posts: 14 Joined: Wed Jun 29, 2016 10:18 am
Post
by hotcore » Wed Jun 29, 2016 12:16 pm
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"
hotcore
Posts: 14 Joined: Wed Jun 29, 2016 10:18 am
Post
by hotcore » Wed Jun 29, 2016 12:23 pm
Found it; use:
Code: Select all
EnableJS
document.title = v_myTitle
DisableJS
SparrowhawkMMU
Posts: 281 Joined: Wed Aug 19, 2015 3:02 pm
Location: United Kingdom
Post
by SparrowhawkMMU » Wed Jun 29, 2016 3:08 pm
I think it needs to be "v_mytitle" i.e. all lower case.
hotcore
Posts: 14 Joined: Wed Jun 29, 2016 10:18 am
Post
by hotcore » Wed Jun 29, 2016 3:24 pm
Thx. Had it working already (with lowercase name