Jump to content

Topic on Talk:Stable interface policy/Frontend

Some confusion around guidance to accessing DOM elements

3
Jdlrobson (talkcontribs)

We currently make clear that consumers should not rely on HTML elements and instead rely on API abstractions that allow us to make changes with less disruption.

For example, the following code would be considered stable:

$( '<div>Hello world</div>').prependTo( mw.util.$content );

The following code wouldn't:

$( '<div>Hello world</div>').prependTo( '#content' );

In the feedback received during August and September, it came to my attention that this was possibly not as clear as it could have been.

I have since made some edits to style to clarify this, and if it can be improved further I would appreciate any feedback.

DKinzler (WMF) (talkcontribs)

This is an excellent example, could you add it to the doc? I think that would make things a lot clearer...

Jdlrobson (talkcontribs)
Reply to "Some confusion around guidance to accessing DOM elements"