JavaScript scripts stop working when page changes the language - javascript

I have a WordPress website with Elementor and a language translator installed. A script for getting the price of Ethereum (every second) is located in the block with the HTML code of this element. There are two languages that set on the website - English, and Israel. The point is when I change the language to Israel the page mirrors horizontally. After that, all the scripts on the page stop working.
Please help me. Thanks.

Related

Creating a pop up that moves to the side after a few seconds

I’m a novice in web design but I can usually achieve what I want using css, html and plugins in WordPress.
I want to create a popup that appears when the homepage loads and then hides off to the side after a few seconds. For a visualization, this site does it exactly.
https://pupunzi.com
Is this possible with just css and html or would I have to learn to use java scripts?

Is my minified javascript conflicting with my AWeber javascript?

I’ve got a page with an AWeber popup form that’s intended to be made visible by clicking a “Get Music” button. You can see it here:
http://www.radionowhere.net
This was working fine until I set up Cloudflare as a CDN for my site and started using it to minify my CSS and JS. Now the Aweber form appears as soon as my page loads, without waiting for the button to be clicked.
Checking the page source, it seems as though the AW javascript in the middle of the page hasn’t been affected by the minification, so I assume the problem must have something to do with conflicting script that Cloudflare has been minified.
Anyone with an idea on how to fix this? Thanks!
Did you have Rocket Loader turned on as well? I'm inclined to say it is less likely of an issue with Minify than Rocket Loader.

WordPress Language Page

I've installed WordPress and played with it for a while. And I got a question how I can make a top page which let visitors to choose their languages.
Let's say there ware two languages for a website, English and Japanese. When a visitor opens the domain root(http://example.com), a selection page appears. If English is clicked, it redirects to the page "http://example.com/en", which has been created by WordPress's page feature(permalink). If it is Japanese, it goes to example(dot)com/jp."
This kind of page is annoying and most of the time useless. As you can automatically detect user browser language and/or ip location, or display a language switcher anywhere in your website.
If you need it anyway, you can try WPML plugin (or other free alternative, if you find one...).
Then you can easily test if you have a detected language and if there is not, display your language chooser.

How to prevent CSS and JS to load if Adblock is detected?

Recently I came across a website that sells adds ( http://buysellads.com/ ) on a friends computer with Adblock enabled and the site seems to detect the browser add-on and it disables the CSS and JS.
I have been trying to read their code, but I can not seem to find the line that makes this happen. I know there are ways to detect and give the user a message to disable the plugin, but I find this way to be more clever.
I appreciate if somebody knows or finds the code that triggers and executes.
Bonus question: How would this work with a cache plugin like W3 Total Cache for Wordpress? I make this question because I wonder how the website would look after the person whitelisted the page and the site refreshes. In theory it should display the CSS and JS because Adblock is not found, but I am not sure if cache plugins would break that and display the site as it looked before without any CSS or JS.
Thanks in advance.
I don't know how this particular site does it, but one possibility is to add/load the JS and CSS files via an ad serving system that is blocked by Adblock (load the style and script tags in an ad placement).
Depending on how Adblock works, it could be enough to host the files on a subdomain like ads.your-domain.com or banner.your-domain.com.
You could then set display=none with inline style on a wrapper containing the whole page, and display=block on an element outside the wrapper, containing the message to the user. The CSS file loaded via an ad serving system could then change the display properties of the two elements (so the users without Adblock gets the content of the page and not the message).

Google Website Translator - Waiting for translation to finish before displaying page

I'm trying to add localization to my site with minimal effort by using Google Website Translator. There's one really annoying snag I've run into though: Every time I try to load a (translated) page, it's displayed briefly in English before Google's javascript does its thing and it toggles to a new language.
I've tried setting "display: none" on my entire HTML body until Google's code finishes running, but I couldn't see anywhere convenient to put the javascript to toggle the display back to normal once the translation code is done without modifying the javascript file that Google loads from Google.
Is there a better solution?
Try Site Translator - http://www.deskshare.com/translation-software.aspx. The full content of your pages is directly on your website so you don't have to worry about the online service being slow or flashing the English text first.

Categories