215 Posts
iliil
5 years ago
3
Topic

Hello

I am loading a Seblod form in a modal box using AJAX and tmpl raw.

The problem is that even in raw view the SEBLOD form contains <script> elements which cause the known conflict with XHR.

"Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience."

see e.g. here

Is there a way to load a SEBLOD form without scripts?

I am sure the SEBLOD team must have faced this issue.

Thanks for help

Michal

Get a VIP membership
5 years ago
1
Level 1

Hello Michal,  

in the raw.php file of your template, add only the display of the component. Remove all other lines.

<jdoc:include type="component" />

Regards.

215 Posts
iliil
5 years ago
0
Level 2

Hi Lionel.

Yes, I do have a clean raw.php but there are many scripts that SEBLOD form view renders directly into the component  e.g.

- fields scripts (e.g. calendar)

- validation script

- JCck.Core.submit_raw script

I know that these scripts are necessary for  SEBLOD form submission for various reasons but rendering them in a raw template is not good for XHR.  Maybe there is a workaround to get rid of these scripts. They can be added manually if needed.

-----

I currently use iframe as a solution to this. It does its job but I would be much happier for a good XHR solution.

Mic

5 years ago
0
Level 1

Hi Mic,

you wrote:  rendering them in a raw template is not good for XHR

I'ml not sure to understand why.  

We have many websites working with that to push data by AJAX, and we never facing issues.  


Regards.

Get a Book for SEBLOD