You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is valid approach that works with all browsers, but seems to work when using: if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { ?>...
Perhaps there is a more elegant way to allow the end user to modify headers to support this without editing the plugin code.
Lastly, there is also an edge case when using browser 'prefetch'. If prefetching, the solution above does not work as it just gets it from the prefetch cache.
The text was updated successfully, but these errors were encountered:
After a little playing around, I suppose a simple option to add x-ajax: true header would be fine and less confusing. Then user just needs to handle the rest to manage the behavior. No experience altering headers though, so I'm not sure of the ramifications.
Thanks for reminding me to try that once again. Just realized I was writing my string with endpoint/? and so there prefetches were being ignored and duplicated. I think that solution works best for now. x-data header also worked fine, but re-writing the prefetch headers wasn't working. This is indeed a simpler solution and works great, cheers.
In order to get php to request only a portion of the x-ajax'ed URL I've had to do the following after researching the topic here:
I'm not sure if this is valid approach that works with all browsers, but seems to work when using:
if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { ?>
...Perhaps there is a more elegant way to allow the end user to modify headers to support this without editing the plugin code.
Lastly, there is also an edge case when using browser 'prefetch'. If prefetching, the solution above does not work as it just gets it from the prefetch cache.
The text was updated successfully, but these errors were encountered: