Wikipedia talk:User scripts/Guide: Difference between revisions

Content deleted Content added
Dimpizzy (talk | contribs)
Weird syntax: new section
Legobot (talk | contribs)
m Bot: Fixing lint errors, replacing obsolete HTML tags: <tt> (5x)
 
(5 intermediate revisions by 2 users not shown)
Line 19:
 
Today User:Zvn edited section "Removing elements". He changed this:
:''To move an element simply attach it in another place with <ttcode>appendChild()</ttcode> or <ttcode>insertBefore()</ttcode>.''
to this:
:''To move an element simply attach it in another place with <ttcode>appendChild()</ttcode> or <ttcode>insertBefore()</ttcode> and remove the original element with <ttcode>removeChild()</ttcode>.''
I am just a beginner javacoder, but I think that is wrong. There is no need to remove the item from the old position manually, that happens automatically when one has inserted it in a new position.
 
Line 93:
 
Is there a reason the code is written <code>document.editform.wpTextbox1.value = "{" + "{wikify}}\n\n" + document.editform.wpTextbox1.value;</code>? Why are the two left brackets separated? [[User:Dimpizzy|Dimpizzy]] ([[User talk:Dimpizzy|talk]]) 17:42, 20 January 2023 (UTC)
 
:Probably to keep {{t|wikify}}'s content from getting substituted into the code, which can happen if you don't wrap your scripts in
<syntaxhighlight lang="js">//<nowiki>
 
scriptGoesHere();
 
//</nowiki></syntaxhighlight>
 
:–[[User:Novem Linguae|<span style="color:limegreen">'''Novem Linguae'''</span>]] <small>([[User talk:Novem Linguae|talk]])</small> 17:45, 20 January 2023 (UTC)
::Ah ok, I just saw the sentence in the page after the code explaining why as well, and I came back here to delete this topic, but you were too quick! [[User:Dimpizzy|Dimpizzy]] ([[User talk:Dimpizzy|talk]]) 17:47, 20 January 2023 (UTC)
:::Hehe :) –[[User:Novem Linguae|<span style="color:limegreen">'''Novem Linguae'''</span>]] <small>([[User talk:Novem Linguae|talk]])</small> 20:24, 20 January 2023 (UTC)