a-ok Posted November 1, 2019 Share Posted November 1, 2019 Quick one. When using JS fetch() rather than jQuery's $.ajax, in my templates if (!$config->ajax) include $config->paths->templates . "head.inc"; seems to be ignored and it returns the head.inc in the response. Am I missing something? Link to comment Share on other sites More sharing options...
Mats Posted November 1, 2019 Share Posted November 1, 2019 Check this: 6 Link to comment Share on other sites More sharing options...
a-ok Posted November 1, 2019 Author Share Posted November 1, 2019 2 hours ago, Mats said: Check this: Many thanks for this, @Mats var request = new Request(url, { headers: new Headers({ 'X-Requested-With': 'XMLHttpRequest' }) }); fetch(request) .then(response => response.text()) .then(data => { console.log(data); }); 6 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now