londonuk371
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to debug Javascript to check a specific behaviorTo show you another example: Here is the same gallery inserted into another WordPress website:
Gallery
And:
1/ The pages are not loaded 2 times.
2/ We can access to the basket (Mon panier) which is not possible on the first website shown because it reloads the page 2 times.- This reply was modified 3 years, 6 months ago by londonuk371.
Forum: Fixing WordPress
In reply to: How to debug Javascript to check a specific behaviorThank you @bedas for your reply.
Yes there are Javascripts errors which are on all the pages.
What I would like to know is which plugin activate the “Chargement en cours” (Loadin in progress) notification between each pages of the iframe.
I would like to desactivate it.
Forum: Developing with WordPress
In reply to: Add some code in a page (Autofilter)I have done this:
<?php add_filter( 'og_og_locale_meta', '__return_empty_string'); echo 'Testing';
But nothing happens, I do have the “Testing” word in my HTML page but it does not change anything on OG metas, they are not empty!
Do I have to use YYZ PHP Code to execute this PHP code add_filter(…) ?
- This reply was modified 4 years, 9 months ago by londonuk371.
Forum: Developing with WordPress
In reply to: Get page language in javascript@corrinarusso You’re right, it’s pretty messy! The best is to go through:
document.documentElement.lang
which return the value of the lang attribute of the<HTML>
tag:
<html class="no-js" lang="en-GB">
This attribute does not depend on the browser language.- This reply was modified 4 years, 10 months ago by londonuk371.
- This reply was modified 4 years, 10 months ago by londonuk371.
Forum: Developing with WordPress
In reply to: Get page language in javascript@corrinarusso haha! The iframe is working fine and full responsive, the iframe is auto-resized according to the height of its content.
It has been standardized by the W3C for long long time. https://www.w3.org/WAI/PF/wiki/IFRAME
Invented by Microsoft in in 1997! :/Forum: Developing with WordPress
In reply to: Get page language in javascript@corrinarusso To be able to launch an iframe with this value:
https://alissart.com/en/boutique/
For now, the iframe language depends on the language of the browser but should first depends on the WordPress page language.
The development of this iframe is not yet finished and miss some options on the iframe top bar, on the side of the “Cart” button, like the Search or the Language.- This reply was modified 4 years, 10 months ago by londonuk371.
Forum: Developing with WordPress
In reply to: Get page language in javascript@corrinarusso Yes for business, I think it’s fine. Indeed, it’s not “en-uk” but “en-gb”. Anyway I will check only the 2 first letters is the return is not NULL.
Forum: Developing with WordPress
In reply to: Get page language in javascriptI got some help and this code which I think is fine:
// tested with the following urls: // url = 'domain.com/sdfsdf/dafsfd?lang=es'; // url = 'domain.com/sdfsdf/dafsfd?lang=es&sdfsf=dfsdf'; // url = 'domain.com/en-uk'; // url = 'domain.com/en-uk/'; // url = 'domain.com/en-uk?dfsdfsdf=dfsdf&sdfsfsdf=dfsdfs'; var url = window.location.href; var lang = getLanguage(url); console.log(lang); function getLanguage(url) { // if language is set via url parameter if (url.includes('?lang=')) { return url.split('?lang=')[1].split('&')[0]; } // if language is set via url route else { return url.split('/')[1].split('?')[0]; } }
Forum: Developing with WordPress
In reply to: Get page language in javascriptYes but you can have your browser in English and looking at a page in French for example.