View Single Post
  #2  
Old 09-17-2014, 06:37 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: HELP-The CLICK function in my script wont work

No problem.

I think this is because X-cart's Smarty template engine is attempting to parse the {} tags in your JS code. Try wrapping it with {literal}{/literal} tags. Additionally you have used {} to display your script tags, when it should be <>. And finally you have included jQuery, and jQuery is already included in X-cart, and it should only be included once.

So you have not made one, but 3 separate errors! I think you should win a gold star.
Try this code, replacing everything you put after {include file="customer/pop18.html"}:
Code:
<script type="text/javascript"> {literal} $(document).ready(function(){ $( ".popup_img_yes" ).click(function() { $( ".popup" ).fadeOut( 1200 ); }); $( ".popup_img_no" ).click(function() { window.open("http://www.google.com","_self"); }); }); {/literal} </script>

So you also need to remove this line: {script src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'}{/script}

And I'm not sure about including a .html file like you have here: {include file="customer/pop18.html"}

I would rename that file to pop18.tpl and pull it in with:
{include file="customer/pop18.html"}

But it may be fine, I've never tried to include a .html file before. Leave it that way at first and tell me if it worked!
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote