| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Problem adding javascript to category description | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() I want to add a link to a category description that will open a new window with a specific size and at the top right of the users screen. Here is the script:
Code:
![]() Here is the code that applies the javascript to the link: Code:
How can I add this javascript to a category?
__________________
Version 4.6.1 Gold [unix] |
|||||||
#2
|
|||||||||
|
|||||||||
![]() The easiest thing to do is to add it to skin1/common.js - then it will be available to any page that calls common.js - which I think may be every page on 4.1.x (if you do this, remove the <script> and </script>)
If you only want to call it on the category pages - you can add it to skin/1/customer/home.tpl with an if/than statement to only use it when you want it. If you add it to a template, be sure to surround it with {literal} and {/literal} tags.
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold (CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module) |
|||||||||
|
#3
|
|||||||
|
|||||||
![]() Adding the javascript to common.js worked perfectly
![]() Thanks for the help.
__________________
Version 4.6.1 Gold [unix] |
|||||||
#4
|
|||||||
|
|||||||
![]() Quote:
I have the same issue and wan to apply this fix. What exactly am I adding to common.js? The whole code that I'm trying to use on the page?
__________________
X-Cart Gold 4.1.10 Add-on: X-AOM (Advanced Order Management) |
|||||||
#5
|
|||||||
|
|||||||
![]() This is my code for having an image with a mouseover area (map). Which part do I add to common.js?
Quote:
__________________
X-Cart Gold 4.1.10 Add-on: X-AOM (Advanced Order Management) |
|||||||
#6
|
|||||||
|
|||||||
![]() ah! think i got it. thanks guys!
__________________
X-Cart Gold 4.1.10 Add-on: X-AOM (Advanced Order Management) |
|||||||
#7
|
|||||||
|
|||||||
![]() Ok so this isn't working on this part. I put the following into skin1/common.js
Quote:
and here's how I call it on the page Quote:
__________________
X-Cart Gold 4.1.10 Add-on: X-AOM (Advanced Order Management) |
|||||||
#8
|
|||||||||
|
|||||||||
![]() When the page is loaded in the browser, is everything intact? What I mean, is all the code reaching the browser? Can you inspect element and see all your code?
__________________
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. |
|||||||||
#9
|
|||||||
|
|||||||
![]() Yes all the code is intact on the live end. The action works when the script is on the page (offsite) but when it's only in common.js, it doesn't seem to do anything.
It worked with mouseover swap images but it's not working with swap divs.
__________________
X-Cart Gold 4.1.10 Add-on: X-AOM (Advanced Order Management) |
|||||||
#10
|
|||||||
|
|||||||
![]() Oh this is embarrassing - I was uploading the unchanged version of common.js. Works now!
__________________
X-Cart Gold 4.1.10 Add-on: X-AOM (Advanced Order Management) |
|||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|