Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2014
    Posts
    51
    Plugin Contributions
    0

    Default Don't understand how to get .js Verifications to show

    Hi Guys,

    So Im setting up a new project and ive got a bunch of security verifications/SSL certificate etc.

    As most will be aware the verifiers simply provide a java script and say copy and paste to the relevant pages.

    Something like below -

    Code:
    <script type="text/javascript" src="https://XXXXXXX/js/1.js" async></script>
    Now im using Anna's westminster New Template and she has her own footer in there, which Is something I think I can work with and figure out

    However Ideally want these verifications shown in the Header.

    Ive copied the above code and created a .js file which is in the Your Templates/JS folder (with the Script tags)

    What I don't understand from there is how would I actually call the script from say the header or link in the footer, what code do I use?

    Ive also tried simply pasting the above with the .js file into the common/tpl_main template file and can't get anything to show up? (Yes I know that won't show in the header...I was trying to get ANYTHING to show up ;) )

    How do I get these things to work?

    Kind Regards,

    John

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,545
    Plugin Contributions
    89

    Default Re: Don't understand how to get .js Verifications to show

    John, you can "package" that javascript into a file named jscript_something.php:
    Code:
    <?php
    //- This will load the 1.js file
    ?>
    <script type="text/javascript" src="https://XXXXXXX/js/1.js" async></script>
    and locate that file in /includes/templates/westminster_new/jscript/jscript_something.php.

    The file will be auto-loaded on every page generated by your Zen Cart installation and located in the page's header.

  3. #3
    Join Date
    Jul 2012
    Posts
    16,739
    Plugin Contributions
    17

    Default Re: Don't understand how to get .js Verifications to show

    Although, be advised that if your pages are offered at all with http: that you will likely get a mixed content notification when using the full src uri that includes https: when visiting such a http: page.

    Also would/could be a problem if the site's folder changes or the template in its entirety is copied to another uri. The more "relative" the link can be made the more flexible the installation and less work needed for future installs/changes.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: Don't understand how to get .js Verifications to show

    <script type="text/javascript" src="https://XXXXXXX/js/1.js" async></script>
    With that template you cannot use the "async" attribute, nor the "defer" for that matter.

    What I don't understand from there is how would I actually call the script from say the header or link in the footer, what code do I use?
    The following files are where you put code according to where you want it to show.

    /includes/templates/westminster_new/common/
    tpl_footer.php
    tpl_header.php
    tpl_main_page.php

    You cannot just insert code wherever you want though. Without knowing more about what the JS is doing it's hard to say exactly where the code should go.

  5. #5
    Join Date
    Jan 2014
    Posts
    51
    Plugin Contributions
    0

    Default Re: Don't understand how to get .js Verifications to show

    Cheers for the help.

    I got it working by doing this -

    Created a .js file containing -
    Code:
    <script type="text/javascript" src="https://cdn.ywxi.net/js/1.js" async></script>
    Then in the tpl_main_page.php put

    Code:
    //- This will load the 1.js file 
    
    <script type="text/javascript" src="https://cdn.ywxi.net/js/1.js" async></script></div>
    Which results in the McAfee secure certificate and verification in the bottom right of the screen.

    http://jphgiftware.com/zc/

    I am however getting the following error relating to the above in the developers inspection when looking at the site.

    Uncaught SyntaxError: Unexpected token <
    Any Ideas?

    I'm now Struggaling with the GoDaddy Version.

    Again just says copy and paste this code to relevant position in the footer......obviously more to it than that.

    Code:
    <span id="siteseal"><script async type="text/javascript" src="https://seal.godaddy.com/getSeal?sealID=YHoxFQxtucBzRVwZaFXehmBwPgont2kHvuRpBSQr0869F9wh8XYm0SpPr5F0"></script></span>
    I know there is a sidebox mod for GD but looks way out of date and I don't wish to add more side boxes other than the categories.

    Cheers for the help guys!

    John

  6. #6
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,699
    Plugin Contributions
    11

    Default Re: Don't understand how to get .js Verifications to show

    in your header you have this:
    Code:
    <script type="text/javascript" src="includes/templates/westminster_new/jscript/jscript_McAfee.js"></script>
    when you go to that link you have this:
    Code:
    <script type="text/javascript" src="https://cdn.ywxi.net/js/1.js" async></script>
    the browser is expecting javascript at that point. instead the first character is '<' which is what is unexpected.

    you are incorrect in thinking that the code is what is giving you the mcAfee seal at the bottom right.

    if you look at your source for your page, the bottom of the page has:

    Code:
    <!-- Mcavee Verification -->
    
    <script type="text/javascript" src="https://cdn.ywxi.net/js/1.js" async></script></div>
    
    <!--- eofMcavee Verification -->
    which is where that seal is coming from.

    my recommendation is to delete this file:

    includes/templates/westminster_new/jscript/jscript_McAfee.js

    which should resolve your 'Uncaught SyntaxError: Unexpected token <' error and you should still have you seal.

    good luck!
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  7. #7
    Join Date
    Jan 2014
    Posts
    51
    Plugin Contributions
    0

    Default Re: Don't understand how to get .js Verifications to show

    Cheers Carl that did indeed fix the error.

    Regards,

    John

 

 

Similar Threads

  1. Help, I don't understand how to install
    By haraaz in forum General Questions
    Replies: 1
    Last Post: 4 May 2011, 08:43 AM
  2. Don't understand how to get rid of zen ads have read faq's
    By robynannelise09 in forum General Questions
    Replies: 8
    Last Post: 4 Nov 2008, 05:56 PM
  3. Don't understand how to install new template in 1.3.8a
    By mamasylvia in forum Templates, Stylesheets, Page Layout
    Replies: 19
    Last Post: 2 Apr 2008, 04:09 PM
  4. fckEditor - don't understand how to install
    By wwwursa in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 4 Feb 2008, 12:12 AM
  5. New Zenner: I don't understand how to upload files!
    By cozyhom in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 8 Oct 2007, 07:44 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR