What is the limit to DOM manipulation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello everyone,
I know that DOM manipulation is a highly discourage way to try and manipulate the DOM as future release may and can break the DOM process as it replace the DOM instead of adding on.
However, I notice that there are some class that are custom such as <sn-search-genius-card-assist>. I'm wondering are they safe from the bad effects of DOM manipulation? How much of the limit I can push? Or, are they more susceptible to be replaced by DOM as they are customer class from ServiceNow?
Thank you all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello @trangdan106 ,
As per my understanding there isn't a specific ServiceNow-defined "limit" such as "you can manipulate 5 DOM elements but not 10." The limit is really about how tightly your code depends on ServiceNow's rendered HTML.
But it also recommends avoiding DOM manipulation where possible because of maintainability and upgrade risk.
Refer this :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
20m ago
Hi, thank you for the link, it was really helpful but would custom SNOW elements such as <sn-search-genius-card-assist> be less affected by changes made when ServiceNow upgrades?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
there are some requirements which you can't do without DOM manipulation
if customer wants that requirement, you need to do that and inform the impact of DOM manipulation
No limit as such it all depends on customer requirement and the script you are using
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
