Solved

Palce a PHP avariable into JQuery Script

Posted on 2014-02-01
2
409 Views
Last Modified: 2014-02-01
How do you place a PHP variable into a JQuey Script?
See currentAmount: below.
<?php
$gaol = "23";
?>

<script>
!function($){
$.fn.extend({
goalProgress: function(options) {
var defaults = {
goalAmount: 100,
[b]currentAmount:.'$goal'.,[/b]
speed: 1000,
textBefore: '',
textAfter: '',
milestoneNumber: 70,
milestoneClass: 'almost-full',
callback: function() {}
}

etc....

</script>

Open in new window

0
Comment
Question by:rgranlund
2 Comments
 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 500 total points
ID: 39826886
Just echo it :)

currentAmount: <?php echo $goal; ?>,

Open in new window

0
 
LVL 7

Author Closing Comment

by:rgranlund
ID: 39826892
Thanks!
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question