<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Uncaught TypeError: found[k].className.match is not a function]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=8162&amp;type=atom" />
	<updated>2021-02-28T14:46:51Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=8162</id>
		<entry>
			<title type="html"><![CDATA[Re: Uncaught TypeError: found[k].className.match is not a function]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39186#p39186" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[itronics]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=89</uri>
			</author>
			<updated>2021-02-28T14:46:51Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39186#p39186</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Uncaught TypeError: found[k].className.match is not a function]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39183#p39183" />
			<content type="html"><![CDATA[<p>I have asked Janusz to look into this item. Hopefully he will respond asap.</p><p>Joe.</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2021-02-26T21:03:30Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39183#p39183</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Uncaught TypeError: found[k].className.match is not a function]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39182#p39182" />
			<content type="html"><![CDATA[<p>@joe: ?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2021-02-26T19:07:04Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39182#p39182</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Uncaught TypeError: found[k].className.match is not a function]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39169#p39169" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[anoopmb]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18207</uri>
			</author>
			<updated>2021-02-23T06:26:09Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39169#p39169</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Uncaught TypeError: found[k].className.match is not a function]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39167#p39167" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[detkenn]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=45282</uri>
			</author>
			<updated>2021-02-22T09:00:30Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39167#p39167</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Uncaught TypeError: found[k].className.match is not a function]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=35048#p35048" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[cambell]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19447</uri>
			</author>
			<updated>2019-05-27T06:26:14Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=35048#p35048</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Uncaught TypeError: found[k].className.match is not a function]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=35038#p35038" />
			<content type="html"><![CDATA[<p>How can I reproduce this error?</p>]]></content>
			<author>
				<name><![CDATA[boxygen]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20175</uri>
			</author>
			<updated>2019-05-26T06:57:30Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=35038#p35038</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Uncaught TypeError: found[k].className.match is not a function]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=35030#p35030" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2019-05-25T08:33:20Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=35030#p35030</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Uncaught TypeError: found[k].className.match is not a function]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34980#p34980" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2019-05-20T17:39:26Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34980#p34980</id>
		</entry>
</feed>
