As it returns something inside a DIV tag, it needs to be in an object's placeholder body code.
Acorn
As it returns something inside a DIV tag, it needs to be in an object's placeholder body code.
Acorn
Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat
Acorn - I think the question is should the script you provided be added to the end of the original script posted, if I am understanding Boy's last post correctly.
Gary W. Priester
Mr. Moderator Emeritus Dude, Sir
gwpriester.com | eyetricks-3d-stereograms.com | eyeTricks on Facebook | eyeTricks on YouTube | eyeTricks on Instagram
Here's a simple example - the detail is in the Names and in the Placeholder HTML code (body).
You change font and colour as normal through Xara.
JS - PageUpdateDetails.xar
You can change the substr parameters for the start point and the number of characters to return.
Each textline and associated code need a different Name if they are on the same page or different across a Supersite.
Acorn
Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat
Gary, you were right, that was my question.
Brilliant Acorn. Short and simple. Thanks. But now the following question: Can I change the date to European format (day, month, year) and possibly have the months in another language, which I could do with the code I posted earlier?
You could change toString() into to UTCString() or even toLocaleString().
You can always use substr(from, length) to cut out bits of the date and time and then join them back together with the + operator.
For other languages, you need toLocaleString(language, options).
Acornvar options = {weekday: "long", year: "numeric", month: "long", day: "numeric"};
document.getElementById("petra").innerHTML = updateDate.toLocaleString("de-DE", options);
P.S. In the end there was no CSS to add as Xara does the styling. We have JavaScript to take the Date object and parse it into readable chunks using locales: https://developer.mozilla.org/en-US/...toLocaleString.
Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat
Took me a while but I got it to work, including the European date format and in Dutch. Very happy with that. However, the code doesn't seem to work in the mobile variant. I also tried it out in two Xara templates but nothing shows on the mobile sites.
This works on my Android and iPhone4:
<p id="updated"></p>
<script>
var d = new Date();
var monthed = d.getMonth();
var dayed = d.getDay();
var dated = d.getDate();
var yeared = d.getFullYear();
var title = "Todays Date is ";
var dayArray = ["Sunday ","Monday ", "Tuesday ", "Wednesday ", " Thursday ", "Friday ", "Saturday "];
dayed = dayArray[dayed];
var dateArray = ["st ","nd ", "rd ","th ","th ","th ","th ","th ","th ","th ","th ","th ","th ","th ","th ","th ","th ","th ","th ","th ","st ","nd ","rd ","th ","th ","th ","th ","th ","th ","th ","st "];
var ending= dated-1;
var ending = dateArray[ending]
var monthArray =["January ", "February ", "March ", "April ", "May ", "June ", "July ", "August ", "September ", "October ", "November ", "December "];
monthed = monthArray[monthed];
var total = title + dayed + " " + dated +ending + " " + monthed + " " + yeared;
document.getElementById("updated").innerHTML = total.fontsize(5);
updated.style.color = "Red";
</script>
Egg
Minis Forum UM780XTX AMD Ryzen7 7840HS with AMD Radeon 780M Graphics + 32 GB Ram + MSI Optix Mag321 Curv monitor + 1Tb SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host
Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat
You probably have to add the detail manually as otherwise there will be two blocks of text with the same ID and only the first one will fire. Stop sharing with variant; copy the text across to the variant; change the Name and Placeholder code. [Afternote: the variant Name seems to need a fudged Name of a prefix "Xxr_v2_"]
Acorn
Last edited by Acorn; 08 August 2016 at 04:48 PM.
Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat
Bookmarks