Google map Joomla error - javascript

Im trying to use google map on this site in the footer where the BRANCHES CONTACT INFO are it should be on the right next to the address but there is a conflict or error not sure what the problem is
here is the site http://consultgp.com/en/

When i look at your website, i've notice you've got JS error
ReferenceError: google is not defined
basicly you don't have included google map api file, at head tag, you should have something like this:
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false" type="text/javascript"></script>
All because you use 'Modules Anywhere' inside Custom Module. To fix it, you need to edit your Custom Module, go to Option Tab, and change 'Prepare Content' to Yes.
With this option, all plugins, and libraries will load.
More about this option you can find at joomla docs.

Related

Is there a way to put some custom code in the header when using Elementor header template

Is there a way to put some custom code in the head of the page? Before Elementor you could do this by editing the header.php file of the template, but now, elementor eliminates all the code from the template, and there is no way (at least an obvious way) to do this. For me this is very important, because I like to put some tags in the code and also this is a perfect way to implement Google Analytics without using any other plugin. Google speed showing to add preload fonts because of speed. I also want to add Preload meta in header but don't want to use plugin. Please suggest better for this.
Thanks
as for google analytics the codes are javascript. you can easily add them into header using "HTML Widget" and then add the code between script tags.
and if you are looking for a way to add php codes, i recommend Dynamic.ooo. the plugin has a widget called "PHP Raw" which lets you write your php in elementor and put it anywhere you want. i myself currently use this plugin and it is a swiss army plugin!

Add custom javascript to wix

I am trying to add custom javascript to wix, but it doesnt work. I have tried almost all I found on google but it doesnt work.
<script type="text/javascript">
window.parent.location.href = "https://url/track"
</script>
The script above needs to be loaded on every wix page, it contains redirection
I was wondering if this is possible in wix?
The way to add custom code to each page in a Wix site is by adding Site code in the built-in IDE.
To access it, enable Dev mode at the top menu and click the Site tab at the editor.
Note that you can't access the DOM directly. However, Wix has a pretty rich API that may cover your needs.
looks like you need to use the wix location API: https://www.wix.com/corvid/reference/wix-location.html#to
From my limited knowledge of wix it seems like your implementation is just wrong for the problem you're trying to solve.
I had a quick read of this article which isn't too old: https://www.wix.com/corvid/forum/community-discussion/page-redirect and it seems like a better approach.
Make sure you've enabled DEV mode and then open the script panel at the bottom of the page.
First, you should import the module that contains the method you need. In your case, that would be wixLocation. Inside the onReady function, you should call winLocation.to method.
import wixLocation from 'wix-location';
$w.onReady(function () {
wixLocation.to("http://some.new.location"))
});

Uncaught ReferenceError: d3 is not defined in WordPress Visual Composer

I want to edit some images which can only be done in WPBakery Page Builder. So, when I try to edit the page with it, the frontend editor (page builder) doesn't loads. Console shows the following error:
Although, the library script tag is added before the tag which is using this library:
I don't know if any of this makes sense, but, yeah, I have tried these solutions because they were mentioned on different forums:
Adding charset="utf-8" to external script tag.
Moving the script tag inside Raw HTML element.
Using $(document).ready(function(){}) to enclose the whole of second
script. So, that it loads after everything is loaded.
Unfortunately, none of these worked for me.
The page builder works fine on pages where I don't use the d3.js library. And, the visualization works fine WHEN NOT IN PAGE BUILDER - the library loads up and the visualization is displayed. You can check it out here:
https://conductscience.com/age-when-charles-darwin/
Also, please note that I don't have access to any of the theme files. So, I can't make any changes to functions.php or any other file.
Your question is related to the WPBakery, not Visual Composer plugin. You need to have the latest version 5.7 in order to fix this issue. More information, contact support.wpbakery.com if you have a valid license.

JS FlexSlider doesn't work in Joomla 3

I have a JS FlexSlider module in my joomla page.
It works fine on all positions but not at the Position I want it to be.
And the position works fine with all other modules.
Here is the page: http://www.ehemalige-hoelderlingym.de
If you check your browser console, you will see a JS error. You also have 2 jQuery libraries being imported which simply means that the developer of FlexSlider has not stuck to Joomla coding standards.
In the Module Parameters, you will see the option Enable jQuery 1.8.2? which you need to set to No.
This will prevent duplicate jQuery libraries being imported and thus most likely fix the console error.
They should really remove this option for the Joomla 3.x version of JS FlexSlider as it is simply not required.
Update:
I've checked Firebug and you're now getting an error because the module is importing the script before jQuery.
You have 3 options:
Option 1: Download and install the jQuery Easy plugin. This will ensure jQuery is loaded only once and before any other script on your site.
Option 2: Create a Template Override for the module and once done, in the default.php change this:
<script src="modules/mod_js_flexslider/assets/js/jquery.flexslider-min.js" type="text/javascript"></script>
to this:
<?php JHtml::_('script', JUri::root() . 'modules/mod_js_flexslider/assets/js/jquery.flexslider-min.js'); ?>
Option 3: Use a different slider extension
Personally I would go with option 3 as you shouldn't have to rely on a 3rd party plugin to get a slider working, and option 2 is something the developer should do.

Google Maps V3 async gives error

For a website I'm trying to load the Google Maps script async, because it makes some browser (Firefox) ignore scrolling before all the scripts are loaded from Google.
I looked at the google developers docs and used their script.
https://developers.google.com/maps/documentation/javascript/examples/map-simple-async
works all perfect as long as you place it inside a <script> tag in your index.html.
But when I place this code for example in my main.js file it isn't working anymore.
Example: http://jsfiddle.net/693xK/
Then I found this example on jsfiddle which seems to work:
http://jsfiddle.net/doktormolle/7cu2F/
But over here the same problem. When I place it inside of my main.js file Google Maps isn't showing up. Everything is global. I get the following error but I don't understand what to do about it. I googled the error message but haven't had any luck.
TypeError: window.initialize is not a function
You're missing to add width and height to your #map-canvas. Also I checked your fiddle, since you're using window.onload = loadScript; so wrap it in head (left corner, under Frameworks & Extensions)
#map-canvas{
width:500px;
height:500px;
}
check this updated JSFiddle.

Categories