Wikipedia talk:WikiProject JavaScript: Difference between revisions

Content deleted Content added
Line 84:
:: According to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf , that returns a number. I'm looking for specific strings, not the position (index) of a string. Thank you, as I was unaware of what this method does. [[User talk:The Transhumanist|<i>The&nbsp;Transhumanist</i>]] 11:00, 6 May 2017 (UTC)
 
:::You will have the starting position of the string and its length (= the length of the substring you are looking for). String.substring() will extract you the matching string - which will be the same as the string you were looking for, except possibly for case. This is how a programmer would do it, not with regexes. [[Special:Contributions/91.155.195.247|91.155.195.247]] ([[User talk:91.155.195.247|talk]]) 15:55, 7 May 2017 (UTC)
 
: I cannot clear see what do you want to achieve, but I find these codes overkill. Mediawiki add titles of actual destinations as attribute <code>title</code> to links and class <code>new</code> for red links.