Solved

Syntax Error

Posted on 2016-10-31
6
50 Views
Last Modified: 2016-10-31
I'm getting a syntax error on this line....

<script type="text/javascript">baseUrl = '{$url}'; token_id = '{$token_id}'; nowPlaying = viewed_id = 0; player_volume = {$volume};</script>

Open in new window

0
Comment
Question by:DS928
6 Comments
 
LVL 28

Expert Comment

by:Pawan Kumar
ID: 41867095
Try..
<script type="text/javascript">
baseUrl = '{$url}'; token_id = '{$token_id}'; nowPlaying = 0; viewed_id = 0; player_volume = {$volume};
</script>
0
 
LVL 22

Accepted Solution

by:
Snarf0001 earned 500 total points
ID: 41867102
You don't have the player_volumne one enclosed in quotes.  JS by itself doesn't understand the templating, so won't be able to parse the tag.

Try this one:

<script type="text/javascript">
baseUrl = '{$url}'; token_id = '{$token_id}'; nowPlaying = viewed_id = 0; player_volume = '{$volume}';
</script>

Open in new window

0
 

Author Comment

by:DS928
ID: 41867106
Doesn't work.....
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 28

Expert Comment

by:Pawan Kumar
ID: 41867117
Try.. Separate out nowPlaying & viewed_id ..
<script type="text/javascript">
baseUrl = '{$url}'; token_id = '{$token_id}'; nowPlaying = 0; viewed_id = 0; player_volume = '{$volume}';
</script>
0
 
LVL 55

Expert Comment

by:Julian Hansen
ID: 41867131
Can you post the full error
0
 

Author Closing Comment

by:DS928
ID: 41867138
Works great.  Thank you..
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to debug htl and js pages 8 39
Index on a Table 6 25
How to display div value on input field value in php 11 53
Angular won't showing my array result in HTML 3 24
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

856 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