To be more to the point: _You can skip to "**The Section of HTML I want to Modify**"_ **and** then _**to point "(6)"**_ for the one approach I think is most important/should work (it's even recommended here on stack, sans my added line trying to tack-on an ID in an "
But otherwise, I figure putting these together means a good opportunity for (a) documenting someone attempting each of these, (b) inviting people to throw their expertise onto this topic, (c) go for the "complete" consideration (the kind you find in their policy on what questions to ask--particularly, completely documenting the problem and several common recommendations/approach that get given to solve it, linked below), (d) go for the "Good/Great Subjective" also mentioned in several of Stack's resources.
id="TicketPseudoReply" class="pseudo_reply">
href="" id="FwdButton" rel="note-button" data-note-type="reply" data-domhelper-name="reply-button" data-replyto-handle="">Reply /
href="" id="FwdButton" rel="note-button" data-note-type="fwd" data-domhelper-name="fwd-button">Forward /
** href="#" rel="note-button" data-note-type="note" data-domhelper-name="note-button">Add note**
href="#" rel="note-button" data-note-type="note" data-domhelper-name="note-button">Add note
**ID="clickEnabledNoteButton"** href="#" rel="note-button" data-note-type="note" data-domhelper-name="note-button">Add note
id="TicketPseudoReply" class="pseudo_reply">
href="" id="FwdButton" rel="note-button" data-note-type="reply" data-domhelper-name="reply-button" data-replyto-handle="">Reply /
href="" id="FwdButton" rel="note-button" data-note-type="fwd" data-domhelper-name="fwd-button">Forward /
**ID="clickEnabledNoteButton"** href="#" rel="note-button" data-note-type="note" data-domhelper-name="note-button">Add note
https://github.com/padolsey/findAndReplaceDOMText/blob/master/src/findAndReplaceDOMText.js
and then
var = findAndReplaceDOMText(a, {
find: 'Add note',
replace: 'Add note'
}
);
var parent = document.getElementByID('id-setting');
var element = parent.GetElementsByTagName('tag')[index-#];
var parentOne = document.getElementById('TicketPseudoReply');
var elementClick = parentOne.GetElementsByTagName('a')[2];
elementClick.setAttribute("id", "clickEnabledNoteButton");
(4) InnerHTML
document.body.innerHTML = document.body.innerHTML.replace('hello', 'hi');
function walkText(node) {
if (node.nodeType == 3) {
node.data = node.data.replace(/foo/g, "bar");
}
if (node.nodeType == 1 && node.nodeName != "SCRIPT") {
for (var i = 0; i < node.childNodes.length; i++) {
walkText(node.childNodes[i]);
}
}
}
walkText(document.body);
(a) I believe because of "node"? that is, it may mean "use 'a'" for my case, but one isn't sure, and(b) it's also difficult to think of using this to walk through all the elements when you just want one,(c) but you wonder if it's to generate an enumeration for other use,(d) the "[...].nodeType == 3 and ==1 lines are great for leading you to another great resource[4] but get you wondering whether "element" is used to mean both the element sign and all its attirbutes together(???).
walkText(document.body.a) or walkText(a) OR ???
var parentOne...
function findThirdDescendant(parent, tagname) {
parent = document.getElementByID(parent);
var descendants = parent.getElementsByTagName(tagname);
if ( descendants.length )
return descendants[2];
return null;
}
var elementClick = findThirdDescendant("TicketPseudoReply", "a");
elementClick.setAttribute("id", "clickEnabledNoteButton");
with this much time gone, I've learned a lot, but really need to get this next step done...and find myself not really knowing whether I ought continuing trying something like this function here,-snipped and put into post linked below for reasons explained below-or just ask for help.Your superior wisdom (even if very mean) is very much appreciated and shall be paid forward (part of the reasons I wrote this process down so thoroughly--so others struggling can use the record). ;) I'm also sure that answers not just about how to fix my incompetent tries but the "why's" about these issues would provide a lot of illuminate for many more than just myself.
http://cmpstuff.blogspot.com/2016/05/references-cited-on-stack-question-yet.html
Enumerated "[1]", "[2]", "[3]" ... like the text above in that post.
There rather than here because <10 rep./new people aren't allowed to post >2 links.
For good reasons.[7](also in the post linked)
No comments:
Post a Comment