Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13
  1. #11
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: page-specific javascript does not work, why??

    Do I correctly read that Zen Cart is properly outputting the page-specific js that you've asked it to?
    And that your problem is really just that your custom javascript/jquery code isn't performing as you intended?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  2. #12
    Join Date
    Dec 2003
    Location
    UPstate NY
    Posts
    440
    Plugin Contributions
    0

    Default Re: page-specific javascript does not work, why??

    Quote Originally Posted by DrByte View Post
    Do I correctly read that Zen Cart is properly outputting the page-specific js that you've asked it to?
    And that your problem is really just that your custom javascript/jquery code isn't performing as you intended?
    Yes. I know the js file works by the above-mentioned alert("alert"); works.
    But anything to change the background color value of the css button containing the phrase 'Check Out' does not work.
    This is why I'm puzzled...and wondering if this particular JS should be in the onLoad??
    I want the proper defined button color to appear when the page loads before anyone ever clicks or mouses anything.

    I've also tried to change the background-color attribute of the btn-primary class with attr() to no avail...

    Thank you, Tom

  3. #13
    Join Date
    Dec 2003
    Location
    UPstate NY
    Posts
    440
    Plugin Contributions
    0

    Default Re: page-specific javascript does not work, why??

    Quote Originally Posted by DrByte View Post
    Do I correctly read that Zen Cart is properly outputting the page-specific js that you've asked it to?
    And that your problem is really just that your custom javascript/jquery code isn't performing as you intended?
    More trial and error got things working:

    1) moved all javascript to its proper place into the bottom of the page in tpl_footer.php, since best practice is to always put all javascript at the bottom of the page

    2) use this code for now:

    if ($("span:contains('Check Out')")) {
    $(".btn-primary").css("color", "green");
    }

    However, the template uses Twitter Bootstrap, which contains horridly excessively complicated css button code, requiring considerably more testing to determine what colors to use etc. depending on the text.

    The jQ code above changes the actual css of the .btn-primary class, in this case the text color for testing.

    Thank you, Tom

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 5
    Last Post: 22 Nov 2014, 04:26 AM
  2. v150 Custom Sort Order does not work
    By DeepGirl in forum Setting Up Categories, Products, Attributes
    Replies: 8
    Last Post: 6 Jun 2014, 04:22 PM
  3. v150 why does this code not work?
    By nazca in forum General Questions
    Replies: 6
    Last Post: 9 Oct 2013, 02:19 PM
  4. Why Does this SQL not work?
    By plymgary1 in forum General Questions
    Replies: 5
    Last Post: 7 Jun 2011, 11:24 AM
  5. Why does it not work? Please help!
    By pasb in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 22 Jul 2009, 04:01 PM

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