Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //---------mob
- <script>
- (function () {
- function triggerAdoricCarousel() {
- var titleContainer = document.querySelector('li.current');
- if (titleContainer) {
- var title = decodeURIComponent(window.title_param).trim();
- var dataSourceUrl = 'https://us-east4-adoric-production.cloudfunctions.net/Support_MimumYashir_dynamicCars?carTitle=' + title;
- try {
- var xhr = new XMLHttpRequest();
- var data = null;
- xhr.addEventListener('readystatechange', function () {
- if (this.readyState === 4) {
- var response = JSON.parse(this.responseText);
- if (response.length > 3) {
- sessionStorage.setItem('showCarsCarousel', this.responseText);
- window.adoric && adoric.trigger('showCarsCarousel');
- }
- }
- });
- xhr.open('GET', dataSourceUrl);
- xhr.send(JSON.stringify(data));
- } catch (error) {
- console.log('error ', error.message);
- }
- }
- }
- if (document.readyState === 'loading') {
- document.addEventListener('DOMContentLoaded', triggerAdoricCarousel);
- } else {
- triggerAdoricCarousel();
- }
- })();
- </script>
- //----------dt
- <script>
- (function () {
- function triggerAdoricCarousel() {
- var titleContainer = document.querySelector('li.current a');
- if (titleContainer) {
- var title = titleContainer.title;
- var dataSourceUrl = 'https://us-east4-adoric-production.cloudfunctions.net/Support_MimumYashir_dynamicCars?carTitle=' + title;
- try {
- var xhr = new XMLHttpRequest();
- var data = null;
- xhr.addEventListener('readystatechange', function () {
- if (this.readyState === 4) {
- var response = JSON.parse(this.responseText);
- if (response.length > 3) {
- sessionStorage.setItem('showCarsCarousel', this.responseText);
- window.adoric && adoric.trigger('showCarsCarouselDT');
- }
- }
- });
- xhr.open('GET', dataSourceUrl);
- xhr.send(JSON.stringify(data));
- } catch (error) {
- console.log('error ', error.message);
- }
- }
- }
- if (document.readyState === 'loading') {
- document.addEventListener('DOMContentLoaded', triggerAdoricCarousel);
- } else {
- triggerAdoricCarousel();
- }
- })();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement