We help IT Professionals succeed at work.
Get Started

Variable  problem: Unexpected identifier

Ivan Golubar
Ivan Golubar asked
Last Modified: 2017-10-30
This is my code:
function show_btn(){
    var actualproject2 = new String('String');
    actualproject2 = <?php echo $_SESSION["actualproject"]; ?> ;
  url: '/wp-content/themes/ne4/PJson.php',
  data:  {
    datatype: "text",
    success: function(strdate){

Open in new window

Uncaught SyntaxError: Unexpected identifier

In debugger I may see:
function show_btn(){
    var actualproject2 = new String('String');
    actualproject2 = First project;

Open in new window

I think the problem is blank space between "First" and "project", because it is also  underlined with red in debugger.
What correction must I perform to resolve this problem?
(i did try to solve it with:     var actualproject2 = new String('String');, but no success)
Watch Question
Software Developer
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE