Body tag attribute

User 515127 Photo


Registered User
109 posts

Is it possible to add an attribute to the body tag within RSD? I frequently want to have an onload event and that seems to be the best place to put the onload="scriptName()" attribute.

I can attach onchange or onblur events to various child elements within the body but can't seem to address the body tag?

It's not a major edit... but every post export edit is something else to go wrong, or to forget, when you reload rsd file to make a small change. I am trying to design within RSD as much as possible because I've discovered that using RSD as simply a more detailed WYSIWYG version of Layout Maker turns around and bites you when you have 100+ lines of hand-code inserted post export. I've learned to keep a spreadsheet of all post export edits but that in itself can add materially to the workload.

Sincerely,
Gordon.
User 187934 Photo


Senior Advisor
18,051 posts

Try using a window load event
$(window).load(myfunc)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

Here's my S-Drive site with
examples of what can be accomplished in VSD.
http://progrower.coffeecup.com/
Here's my CoffeeCup SCCP Shop with examples of what can be done.
http://progrower.coffeecup.com/shop/
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personnel site used for testing and as an easy way to share photos.(RLM imported to RSD)
http://ericrohloff.com
http://ericrohloff.com/property/
User 379556 Photo


Registered User
659 posts

I have needed to add an attribute to the body tag on a number of pages of my website, and have done it wholly within RSD as follows.

(a) I select the Grid, and go to the Design panel.
(b) In the Attributes section I select Custom from the drop-down menu.
(c) In the Name box I enter (without the inverted commas) "onload".
(d) In the Value box I enter (without the inverted commas) "scriptName();"

It is possible to enter more than one "scriptName();" as proved necessary in some of my pages to accommodate both
(i) search-result highlighting and
(ii) refs to multiple iframes within paragraphs.
Looking at the source code of, for example, this page will show what I mean.

Frank
User 232214 Photo


COO
819 posts

gllincoln wrote:
when you have 100+ lines of hand-code inserted post export. I've learned to keep a spreadsheet of all post export edits but that in itself can add materially to the workload.


We are working on a developer / cms edition that will help out here. If you want to join the beta, please send us a note through your support room Gordon.

https://www.coffeecup.com/help/myroom/
The future of web layout has arrived and it's called CSS Grid. CoffeeCup helps you to get ready with a free guide, the Grid Builder app plus cool demos & themes.
User 515127 Photo


Registered User
109 posts

Eric Rohloff wrote:
Try using a window load event
$(window).load(myfunc)


Thank you Eric - I'll give that a try.

Sincerely,
Gordon
User 515127 Photo


Registered User
109 posts

Frank Cook wrote:
I have needed to add an attribute to the body tag on a number of pages of my website, and have done it wholly within RSD as follows.

(a) I select the Grid, and go to the Design panel.
(b) In the Attributes section I select Custom from the drop-down menu.
(c) In the Name box I enter (without the inverted commas) "onload".
(d) In the Value box I enter (without the inverted commas) "scriptName();"

Frank


Thank you Frank! Never occurred to me to attach the event to the grid ! I'll give that a try. Great idea and I've bookmarked your site for further study.

Sincerely,
Gordon


Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.