* Waplocus * Graham Plz Graham I've Tried Includin xt:Include in the js math below code plz fix it 4 me. thanks
/* START */
var quotes=new Array()

quotes[0]='<xt:include file="/EXT/Aji1" />'

quotes[1]='<xt:include file="/EXT/Aji2" />'

quotes[2]='<xt:include file="/EXT/Aji3" />'

/* END */
var whichquote=Math.floor(Math.random()*(quotes.length))
document.write(quotes[whichquote])

Copy code
2016-07-14 09:36 · (0)
* Lordeagle * Waplocus Javascripts slows down page load, why not use xt random include? Am not with the function code by heart, but google will get you there if u search with the bold phrase above or surf http://tutorial.graham.yn.lt .
If u must use javascript learn to always end every javascript statement with a semicolon ;, and make sure that the string contained in the files that u wanna include has no single quot ' in it.
2016-07-14 10:03 (edited 2016-07-14 10:08 by Lordeagle ) · (0)
* Graham * Waplocus It will work but only if the script is on the actual page it will not work from a js file called as a script src as they are not parsed by xtgem they are parsed by the browser
also the quotes must all be on one line in the included files or it breaks the javascript
demo http://adgj.mw.lt/files/test_1
A random include is <xt:include file="/folder/*" />
see http://syntax.xtgem.com/manual/xtgem/default?func=xt_include
random included files can contain anything
2016-07-14 10:11 (edited 2016-07-14 10:37 by Graham ) · (0)
* Waplocus * Graham Please Explain The <xt:includefile="/random_includes/*" />
2016-07-14 10:52 · (0)
* Graham * Waplocus
you just replace the file name with the * it then picks a random file from the folder
<xt:include file="/EXT/*" />
Copy code
if you want to use it more than once from the same folder on the same page you just add another variable and value pair to make it re-cache the random value
<xt:include id="whatever" file="/EXT/*" />
Copy code
The folder must only contain the files you want to include nothing else
thats it no javascript required
your 'quote' files can even be html pages as the headers are stripped before the file is included
only the body content is used
2016-07-14 12:44 (edited 2016-07-14 13:00 by Graham ) · (0)
* Waplocus * Graham wot of the index file in the folder, wil it also include it?.
2016-07-14 21:46 (edited 2016-07-14 22:50 by Waplocus ) · (0)
* Graham * Waplocus Give the quote files their own extension and use it in the include
ie <xt:include file="/EXT/*.txt" />
Then it will only include files with that extension
http://adgj.mw.lt/files/test_1 the first include is done this way
Even I did not know you could do this but I just tested it and it works!
Note this does not seem to work with the id="whatever" for multiple use and it makes the include fail But I am looking into it
2016-07-14 23:02 (edited 2016-07-15 03:57 by Graham ) · (0)
* Waplocus * Graham Thanks
2016-07-15 02:44 · (0)
* Waplocus * Waplocus Plz I Want To Pay 4 My Hosting On Xtgem And In Return I Want U Guy To Remve Ads Nd Make PHP To Run On My Site, Wud Dat B Possible?.
2016-07-15 02:52 · (0)
* Graham * Waplocus At present there is no upgrade system in place
To be honest there was so much fraud it ended up costing us a lot more than the income we got from it
2016-07-15 03:25 · (0)

Online: Guests: 1