0

Possible Duplicate:
Partially skip sections with Google Closure Compiler

I get the following error from the compiler:

Number of errors: 2

JSC_PARSE_ERROR: Parse error. syntax error at line 17 character 18
window.location = <?php echo $this->baseUrl(); ?>"/";
                  ^
JSC_PARSE_ERROR: Parse error. syntax error at line 17 character 47
window.location = <?php echo $this->baseUrl(); ?>"/";
                                               ^

It doesn't seem to like the (php) syntax. Any suggestion?

Community
  • 1
  • 1
S D
  • 135
  • 1
  • 11

1 Answers1

1

Isolated the code in a string:

window.location = eval("<?php echo $this->baseUrl(); ?>") + "/";

this is a similar problem to:

https://code.google.com/p/closure-compiler/wiki/UsingConditionalCommentWithClosureCompiler

John
  • 5,443
  • 15
  • 21