954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Can any ocrne tell me how to echo javasipt in php

Can anyHere my code:

<script language="javascript" type="text/javascript">
			jQuery(document).ready(function() {
				$('#countdown_dashboard').countDown({
					targetDate: {
						'day': 		17,
						'month': 	9,
						'year': 	2010,
						'hour': 	1,
						'min': 		0,
						'sec': 		0
					}
				});
				
						});
		</script>
designer_shiv
Newbie Poster
10 posts since Jun 2010
Reputation Points: 10
Solved Threads: 0
 

What exactly are you trying to accomplish here? This is also javascript, specifically jQuery, not php.

Nyight
Junior Poster
100 posts since Aug 2010
Reputation Points: 23
Solved Threads: 21
 
//save everything up to "SCRIPT;" in the variable $js
$js<<<SCRIPT
<script language="javascript" type="text/javascript">
			jQuery(document).ready(function() {
				$('#countdown_dashboard').countDown({
					targetDate: {
						'day': 		17,
						'month': 	9,
						'year': 	2010,
						'hour': 	1,
						'min': 		0,
						'sec': 		0
					}
				});
				
						});
		</script>
SCRIPT;
/*note the line where you see "SCRIPT;" MUST end with a semicolon IMMEDIATELY followed by a NEWLINE. If you leave spaces, you will get a runtime error. */

//now echo the javascript.
echo $js;
hielo
Veteran Poster
1,124 posts since Dec 2007
Reputation Points: 116
Solved Threads: 244
 

Hey Thanks Great Help

designer_shiv
Newbie Poster
10 posts since Jun 2010
Reputation Points: 10
Solved Threads: 0
 

line 2 is missing an equal sign. It should be:

$js=<<<SCRIPT


>>Hey Thanks Great Help
Glad to help

PS: Be sure to mark the thread as solved.

hielo
Veteran Poster
1,124 posts since Dec 2007
Reputation Points: 116
Solved Threads: 244
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: