kartik-v/yii2-tabs-x

jquery.js:9455 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.

ScottHuangZL opened this issue · 1 comments

The tab x is work for normal situation, or the ajax which the Json::encode($html) do not include any js assets.

I encounter one issue when try use Ajax call:
The Json::encode($html) contain highcharts JS. (use miloschuman\highcharts\Highcharts;)

It cannot successful render and report warning as below:
jquery.js:9455 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.

I am try to change return Json::encode($html) to return $html for testing the generated view string only, it is work. So, it mean just tab-x cannot show up the the correct Json::encode($html) in case it include JS itself.

Can you advise the solution? Thanks.

Close issue.

use try tricks to make it work:
$html = str_replace('"renderTo":"w0"','"renderTo":"demandContentId"',$html);
$html = str_replace('id="w0"','id="demandContentId"',$html);
return Json::encode($html);

So, the key thing is define id in tabs, and replace the generated html with that personal defined id.
It is better for tabx can consider this kind of situation together.