Post by i2Paq » Wed Jun 08, 2016 4:39 am

In my "old" 1.5.4.1 store I'm running a Java script in an additional CR2 HTML module and this works fine.

Now I want to do the same in my new 2.2.0.0 store in the HTML module.

All I see is the code itself.

What am I missing?

Code: Select all

<script type="text/javascript">
    <!--
    var now = new Date();
    var url;

    var image1 = new Image();
    image1.src="http://cdn.knmi.nl/knmi/map/page/weer/waarschuwingen_verwachtingen/zonkracht/zonkracht_dag0.gif?"+now.getHours()+now.getMinutes()+now.getSeconds();
    url= '<img id="zonkrachtverwachting" src="'+image1.src+'" width="160" border=0 vspace=0 hspace=0 valign=top usemap="#zonkracht_verwachting">';
    document.writeln( url );
    //-->
    </script>
    <noscript>
    <img id="zonkrachtverwachting" src="http://cdn.knmi.nl/knmi/map/page/weer/waarschuwingen_verwachtingen/zonkracht/zonkracht_dag0.gif" border=0 vspace=0 hspace=0 valign=top usemap="#zonkracht_verwachting">
    </noscript>
    <map name="zonkracht_verwachting">
    <area shape="rect" alt="Zonkrachtverwachting dag 1" coords="15,176,157,185" href="http://www.knmi.nl/nederland-nu/weer/waarschuwingen-en-verwachtingen/zonkracht" target="_blank" title="Zonkrachtverwachting dag 1">
    <area shape="rect" alt="Zonkrachtverwachting dag 2" coords="15,186,157,194" href="http://www.knmi.nl/nederland-nu/weer/waarschuwingen-en-verwachtingen/zonkracht" target="_blank" title="Zonkrachtverwachting dag 2">
    <area shape="rect" alt="Informatie over de zonkracht" coords="149,0,159,10" href="http://www.knmi.nl/nederland-nu/weer/waarschuwingen-en-verwachtingen/zonkracht" target="_blank" title="Informatie over de zonkracht" target="legenda">
    <area shape="rect" alt="Verwachte zonkracht voor de komende dagen" coords="9,23,154,139" href="http://www.knmi.nl/nederland-nu/weer/waarschuwingen-en-verwachtingen/zonkracht" target="_blank" title="Verwachte zonkracht voor de komende dagen">
    <area shape="default" nohref>
    </map>
The funny thing is that when I click on Source view and add the code and click on Source view again it will show what I should see on my store front.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by inactiveaccount9912 » Tue Jun 14, 2016 1:02 am

Use it like below and it will work the same.

Code: Select all

<div id="zonkrachtverwachtingdiv"></div>
    <script type="text/javascript">
    <!--
    var now = new Date();
    var url;

    var image1 = new Image();
    image1.src="http://cdn.knmi.nl/knmi/map/page/weer/waarschuwingen_verwachtingen/zonkracht/zonkracht_dag0.gif?"+now.getHours()+now.getMinutes()+now.getSeconds();
    url= '<img id="zonkrachtverwachting" src="'+image1.src+'" width="160" border=0 vspace=0 hspace=0 valign=top usemap="#zonkracht_verwachting">';
    document.getElementById("zonkrachtverwachtingdiv").innerHTML=url; 
    //-->
    </script>
    <noscript>
    <img id="zonkrachtverwachting" src="http://cdn.knmi.nl/knmi/map/page/weer/waarschuwingen_verwachtingen/zonkracht/zonkracht_dag0.gif" border=0 vspace=0 hspace=0 valign=top usemap="#zonkracht_verwachting">
    </noscript>
    <map name="zonkracht_verwachting">
    <area shape="rect" alt="Zonkrachtverwachting dag 1" coords="15,176,157,185" href="http://www.knmi.nl/nederland-nu/weer/waarschuwingen-en-verwachtingen/zonkracht" target="_blank" title="Zonkrachtverwachting dag 1">
    <area shape="rect" alt="Zonkrachtverwachting dag 2" coords="15,186,157,194" href="http://www.knmi.nl/nederland-nu/weer/waarschuwingen-en-verwachtingen/zonkracht" target="_blank" title="Zonkrachtverwachting dag 2">
    <area shape="rect" alt="Informatie over de zonkracht" coords="149,0,159,10" href="http://www.knmi.nl/nederland-nu/weer/waarschuwingen-en-verwachtingen/zonkracht" target="_blank" title="Informatie over de zonkracht" target="legenda">
    <area shape="rect" alt="Verwachte zonkracht voor de komende dagen" coords="9,23,154,139" href="http://www.knmi.nl/nederland-nu/weer/waarschuwingen-en-verwachtingen/zonkracht" target="_blank" title="Verwachte zonkracht voor de komende dagen">
    <area shape="default" nohref>
    </map>

Expert Member

Posts

Joined
Fri May 14, 2010 2:36 am

Post by i2Paq » Tue Jun 14, 2016 1:59 am

Thanks!

It sure works :D

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by labeshops » Sat Jul 02, 2016 8:35 am

having problems running javascript in the html module. Trying to put in the following into the module so I can use it in several places, but when I save in the html module, it wipes out the code. Thought perhaps the html module in 2.2 didn't support javascript, but then saw this post so wondering wth I'm doing wrong?

Code: Select all

<script language="JavaScript" type="text/javascript">
TrustLogo("https://www.domain.com/image/catalog/comodo_secure_seal_76x26_transp.png", "CL1", "none");
</script>
<a  href="https://www.instantssl.com/" id="comodoTL">
SAFE & SECURE</a>


Running Opencart v3.0.3.9 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by inactiveaccount9912 » Sat Jul 02, 2016 7:11 pm

After you added the code in source mode of summernote, switch back to view mode before saving.

Expert Member

Posts

Joined
Fri May 14, 2010 2:36 am

Post by labeshops » Sat Jul 02, 2016 8:28 pm

florinsith wrote:After you added the code in source mode of summernote, switch back to view mode before saving.
I normally do, but for some reason it won't let me when I add this code. It's like the <> button is stuck.

Running Opencart v3.0.3.9 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by IP_CAM » Sun Jul 03, 2016 2:31 am

Even for very a simple task, like adding the img-responsive class tag (in source mode) to a Product Description Section Image, I had to switch back to WysiWyg Mode, to keep it existing in Place, and working, exactly contrary to, what I am used to do in the cKeditor.

But, as I found out, Summernote has made many improvements/updates, (still not even V.1.0 YET!!) and OC v.2.2 still used an outdated pre-release Version, so, I would, if I would care about, at least install the latest Summernote from Github, and then, try again ! :D
Ernie

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by labeshops » Sun Jul 03, 2016 3:59 am

thanks. tried updating summernote to the newest version and it still will not go back out of code view when I use my code. when I tried the script the op had here, it worked fine, so wondering if there is something wrong with the trustseal code I'm trying to use that I'm missing??

Running Opencart v3.0.3.9 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by inactiveaccount9912 » Mon Jul 04, 2016 9:17 pm

Use it like this:

Code: Select all

<script language="JavaScript" type="text/javascript">
if(typeof TrustLogo == 'function') {
TrustLogo("https://www.domain.com/image/catalog/comodo_secure_seal_76x26_transp.png", "CL1", "none");
}
</script>
now it wont do anything in admin and youll be able to save. It will work in front as long as that function does exist.

Expert Member

Posts

Joined
Fri May 14, 2010 2:36 am

Post by labeshops » Tue Jul 05, 2016 3:19 am

You are awesome!! Thanks. That worked :)

Running Opencart v3.0.3.9 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA
Who is online

Users browsing this forum: No registered users and 6 guests