Announcement

Collapse
No announcement yet.

Pulling a 3dcart Variable into a jQuery script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pulling a 3dcart Variable into a jQuery script

    I've been studying jQuery. I know just enough to make me feel stupid.

    I'm trying to make a lease rate calculator and I want to pull in the item [price] but don't understand how to get/reference that value in my external script.

    Any clues?
    Webmaster: Texas Media Systems

  • #2
    set a variable on your page before you call your script

    HTML Code:
    <script>
      var price = '[price]'
    
      //run your function here or call it from a script after the variable is instantiated
    
    </script>
    note: regardless of whether its in html, or attributes, or javascript variables - anything in bracket syntax (that's within its proper comment trigger tags) will be replaced with the desired output when the page renders. This means your variable will show up in plain text by the time your script is able to use it.

    Comment


    • #3
      UGH! I wasn't paying attention to the DOM! I had tried that but didn't catch my mistake until your comment "after the variable is initiated."

      Thank you, thank you!
      Webmaster: Texas Media Systems

      Comment


      • #4
        not a problem. glad i could help.

        Comment

        Working...
        X