<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Uncaught TypeError: found[k].className.match is not a function]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=8162</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=8162&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Uncaught TypeError: found[k].className.match is not a function.]]></description>
		<lastBuildDate>Sun, 28 Feb 2021 14:46:51 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Uncaught TypeError: found[k].className.match is not a function]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=39186#p39186</link>
			<description><![CDATA[<p>Yes, while I have not found the issue on standard themes, this can be a problem when SVG element are used.<br />Thank you for investigating the issue, I have pushed <a href="https://sourceforge.net/p/frontaccounting/git/ci/d34b343494b41494469fc0c2887ad85e6712ea32/">the fix</a> to FA repo.<br />J.</p>]]></description>
			<author><![CDATA[null@example.com (itronics)]]></author>
			<pubDate>Sun, 28 Feb 2021 14:46:51 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=39186#p39186</guid>
		</item>
		<item>
			<title><![CDATA[Re: Uncaught TypeError: found[k].className.match is not a function]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=39183#p39183</link>
			<description><![CDATA[<p>I have asked Janusz to look into this item. Hopefully he will respond asap.</p><p>Joe.</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Fri, 26 Feb 2021 21:03:30 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=39183#p39183</guid>
		</item>
		<item>
			<title><![CDATA[Re: Uncaught TypeError: found[k].className.match is not a function]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=39182#p39182</link>
			<description><![CDATA[<p>@joe: ?</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Fri, 26 Feb 2021 19:07:04 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=39182#p39182</guid>
		</item>
		<item>
			<title><![CDATA[Re: Uncaught TypeError: found[k].className.match is not a function]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=39169#p39169</link>
			<description><![CDATA[<p>This issue probably happens when using jquery and its conflict match in jquery</p><p>Another fix is to change match with test</p><div class="codebox"><pre><code>if (found[k].className &amp;&amp; new RegExp(&#039;\\b&#039;+className+&#039;\\b&#039;).test(found[k].className)) {
     currentContext[currentContextIndex++] = found[k];
}</code></pre></div><p>like this</p><p>Note: match returns array or null but test returns boolean true or false</p><p>Also need to clear the cache to take effect new change</p>]]></description>
			<author><![CDATA[null@example.com (anoopmb)]]></author>
			<pubDate>Tue, 23 Feb 2021 06:26:09 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=39169#p39169</guid>
		</item>
		<item>
			<title><![CDATA[Re: Uncaught TypeError: found[k].className.match is not a function]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=39167#p39167</link>
			<description><![CDATA[<p>I have experienced the same error. As @Cambell said, there are some cases where className may not be a string e.g an SVGSVGElement. This is happening to me when am am developing a theme that uses SVG Elements. <br />I suggest change of varriable &quot;found[k].className&quot; to &quot;found[k].getAttribute(&#039;class&#039;)&quot; as shown below:</p><p>Line 164 change from:<br /></p><div class="codebox"><pre><code>if (found[k].className &amp;&amp; found[k].className.match(new RegExp(&#039;\\b&#039;+className+&#039;\\b&#039;))) {</code></pre></div><p>To<br /></p><div class="codebox"><pre><code>if (found[k].getAttribute(&quot;class&quot;) != null &amp;&amp; found[k].getAttribute(&quot;class&quot;).match(new RegExp(&#039;\\b&#039;+className+&#039;\\b&#039;))) { </code></pre></div><p>Please consider this fix</p>]]></description>
			<author><![CDATA[null@example.com (detkenn)]]></author>
			<pubDate>Mon, 22 Feb 2021 09:00:30 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=39167#p39167</guid>
		</item>
		<item>
			<title><![CDATA[Re: Uncaught TypeError: found[k].className.match is not a function]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35048#p35048</link>
			<description><![CDATA[<div class="quotebox"><cite>kvvaradha wrote:</cite><blockquote><p>Full error details. <br /></p><div class="codebox"><pre><code>Uncaught TypeError: found[k].className.match is not a function
    at HTMLDocument.document.getElementsBySelector (behaviour.js:25)
    at Object.apply (behaviour.js:6)</code></pre></div></blockquote></div><p>From the stack trace it looks like in the implementation of getElementsBySelector (behaviour.js:164) the property &quot;className&quot; is not guaranteed to be a string.&nbsp; If it was a String, then &quot;match&quot; would exist.&nbsp; </p><div class="codebox"><pre><code>        if (found[k].className &amp;&amp; found[k].className.match(new RegExp(&#039;\\b&#039;+className+&#039;\\b&#039;))) {
          currentContext[currentContextIndex++] = found[k];
        }</code></pre></div><p>According to MDN there are some cases where className may not be a string.<br /><a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/className">https://developer.mozilla.org/en-US/doc … /className</a></p><p>A reasonable check for string to use would be</p><div class="codebox"><pre><code>Object.prototype.toString.call(found[k].className) === &#039;[object String]&#039;</code></pre></div><p>There is likely some other error that is causing there to be a non-string DOM element in the className list on the given selector which shouldn&#039;t be there.&nbsp; However, this javascript code should be protected from the error anyway.</p>]]></description>
			<author><![CDATA[null@example.com (cambell)]]></author>
			<pubDate>Mon, 27 May 2019 06:26:14 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35048#p35048</guid>
		</item>
		<item>
			<title><![CDATA[Re: Uncaught TypeError: found[k].className.match is not a function]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35038#p35038</link>
			<description><![CDATA[<p>How can I reproduce this error?</p>]]></description>
			<author><![CDATA[null@example.com (boxygen)]]></author>
			<pubDate>Sun, 26 May 2019 06:57:30 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35038#p35038</guid>
		</item>
		<item>
			<title><![CDATA[Re: Uncaught TypeError: found[k].className.match is not a function]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=35030#p35030</link>
			<description><![CDATA[<p>Use the non-minified version of the js file and debug it.<br />See:<br />https://stackoverflow.com/questions/16266440/typeerror-match-is-not-a-function<br />https://stackoverflow.com/questions/38557550/uncaught-typeerror-function-is-not-a-function</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sat, 25 May 2019 08:33:20 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=35030#p35030</guid>
		</item>
		<item>
			<title><![CDATA[Uncaught TypeError: found[k].className.match is not a function]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=34980#p34980</link>
			<description><![CDATA[<p>This error occurs, when we select items ,or customers from the drop down on the invoice page. Sometimes it comes after login. looks like a core level js issue. needs to be identified. why it comes sometimes.&nbsp; </p><p>looking developers opinion to identify the issue exactly.</p><p>Full error details. <br /></p><div class="codebox"><pre><code>Uncaught TypeError: found[k].className.match is not a function
    at HTMLDocument.document.getElementsBySelector (behaviour.js:25)
    at Object.apply (behaviour.js:6)
    at utils.js:24
    at JsHttpRequest.req.onreadystatechange (JsHttpRequest.js:84)
    at JsHttpRequest.t._changeReadyState (JsHttpRequest.js:71)
    at JsHttpRequest.t._dataReady (JsHttpRequest.js:50)
    at Function.JsHttpRequest.dataReady (JsHttpRequest.js:88)
    at Function.JsHttpRequest._tmp (eval at xr.onreadystatechange (JsHttpRequest.js:104), &lt;anonymous&gt;:1:1237)
    at XMLHttpRequest.xr.onreadystatechange (JsHttpRequest.js:106)</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (kvvaradha)]]></author>
			<pubDate>Mon, 20 May 2019 17:39:26 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=34980#p34980</guid>
		</item>
	</channel>
</rss>
