Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: JavaScript on product page problems

    Try deleting the first two and last two lines from your javascript file, so that you are left with just the javascript.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  2. #12
    Join Date
    Oct 2007
    Posts
    106
    Plugin Contributions
    0

    Default Re: JavaScript on product page problems

    wow that worked great...thanks so much. OK so last question. Do I add additional java codes to the same "header" page if I want to have additional codes or should I create a separate one for each code?

  3. #13
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: JavaScript on product page problems

    Be careful not to confuse Java with Javascript - they're very different languages.

    If the additional javascript is for the same page, put it in the same file.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  4. #14
    Join Date
    Oct 2007
    Posts
    106
    Plugin Contributions
    0

    Default Re: JavaScript on product page problems

    OK thanks so much for all your help kuroi, I really appreciate it...If you feel like helping with the other things please check these posts hehe...

    The only issue on this one left if the white space problem in IE6 above the header logo
    http://www.zen-cart.com/forum/showthread.php?t=78656

    Next is the add to cart function problem. The 2 main things here is getting the top one to work and replacing "add to cart" text with the image below it...please see this post:
    http://www.zen-cart.com/forum/showthread.php?t=78796

    Finally, I'm having problems with UPS shipping XML, I don't know if this is your area at all but please see the post below:
    http://www.zen-cart.com/forum/showthread.php?t=78786

    I'm not sure what to do about the shipping, I followed all the directions from the devs. I have taken it down temp, to check other options but I would really prefer to use USPXML if I can get it up and running with some support.

    So any help on these would be much appreciated but if you can't let me just give you a big hug and say thank you for helping with the java(script) code stuff.

    Zidain~

  5. #15
    Join Date
    Nov 2007
    Posts
    270
    Plugin Contributions
    0

    Default Re: JavaScript on product page problems

    O.K. here is another "dense" person.. I have the following code saved in:
    /includes/modules/pages/products_info/jscript_soldoriginals.js
    Code:
    var newsText = new Array();
    newsText[0] = "If you wish to order a custom made Original of this painting or other African wildlife, please call the artist, Clive Kay at 1-705-454-9637. Clive will be pleased to discuss your request with you.";
    var ttloop = 1;    // Repeat forever? (0 = True; 1 = False)
    var tspeed = 50;   // Typing speed in milliseconds (larger number = slower)
    var tdelay = 1000; // Time delay between newsTexts in milliseconds
    // ------------- NO EDITING AFTER THIS LINE ------------- \\
    var dwAText, cnews=0, eline=0, cchar=0, mxText;
    function doNews() {
      mxText = newsText.length - 1;
      dwAText = newsText[cnews];
      setTimeout("addChar()",1000)
    }
    function addNews() {
      cnews += 1;
      if (cnews <= mxText) {
        dwAText = newsText[cnews];
        if (dwAText.length != 0) {
          document.news.news2.value = "";
          eline = 0;
          setTimeout("addChar()",tspeed)
        }
      }
    }
    function addChar() {
      if (eline!=1) {
        if (cchar != dwAText.length) {
          nmttxt = ""; for (var k=0; k<=cchar;k++) nmttxt += dwAText.charAt(k);
          document.news.news2.value = nmttxt;
          cchar += 1;
          if (cchar != dwAText.length) document.news.news2.value += "_";
        } else {
          cchar = 0;
          eline = 1;
        }
        if (mxText==cnews && eline!=0 && ttloop!=0) {
          cnews = 0; setTimeout("addNews()",tdelay);
        } else setTimeout("addChar()",tspeed);
      } else {
        setTimeout("addNews()",tdelay)
      }
    }
    doNews()
    Now on the product I wish this script to run, I put the following:
    Code:
    <script src="jscript_soldoriginals.js" type="text/javascript"></script>
    <form name="news">
    <font color="#cc9900"><b>
    <br /></b></font></form>
    But nothing is happening..

    Thanks in advance and Happy New Year!

  6. #16
    Join Date
    Nov 2007
    Posts
    270
    Plugin Contributions
    0

    Default Re: JavaScript on product page problems

    Now on the product I wish this script to run, I put the following:
    Code:
    <script src="jscript_soldoriginals.js" type="text/javascript"></script>
    <form name="news">
    <font color="#cc9900"><b>
    <br /></b></font></form>
    But nothing is happening..

    Thanks in advance and Happy New Year![/QUOTE]

    Ups, the second code is missing a line, it is as follows:
    Code:
    <script src="jscript_soldoriginals.js" type="text/javascript"></script>
    <form name="news">
    <font color="#cc9900"><b>
    <textarea name="news2" cols="40" rows="6" wrap="virtual">
    </textarea></b></font></form>
    But I still don't see the text in the textarea...

    When I went back to double check the code, it puts in extras:

    Code:
    <script type="text/javascript" src="jscript_soldoriginals.js"></script>
    <form name="news">
    <font color="#cc9900"><b>
    <textarea wrap="virtual" rows="6" cols="40" name="news2">&lt;/body&gt;
    &lt;/html&gt;&lt;/HTML&gt;</textarea></b></font></form>
    If this is my problem, how do I keep it from appearing in the text area??

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Help a newbie install a piece of javascript with product vars on a product page
    By jhkaplan in forum Templates, Stylesheets, Page Layout
    Replies: 18
    Last Post: 1 May 2012, 05:35 PM
  2. Problems integrating php/javascript on main page
    By webrock in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 23 Jan 2009, 05:20 AM
  3. Add JavaScript to one product page
    By jeking in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 26 Feb 2008, 08:26 PM
  4. how do I add a javascript in product page
    By reza in forum Contribution-Writing Guidelines
    Replies: 0
    Last Post: 31 May 2007, 11:54 AM

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