0

What I want to do is, set a variable as "Scheduler/Get" if the mode is Debug and "GI/Scheduler/Get" if the mode is Release.

I know that in C# code, I should do something like this:

string x = "";

#if DEBUG
  x = "Scheduler/Get";
#else
  x = "GI/Scheduler/Get";
#endif

The problem is that I want to do it in a javascript method inside my view. Is that possible?

Thank you

Evil Str
  • 132
  • 9
  • What's your issue? Yes that's possible. Probably be cleaner to chuck in a helper – johnny 5 Jun 27 '17 at 19:07
  • That issue is exactly what I wrote. I want to write something if the program is in debug mode and other thing if it is in realease mode. But inside a javascript method in my view. – Evil Str Jun 28 '17 at 12:02
  • Why can't you do what I said? Make a helper method to return whether your on debut mode and just use that conditionally to write JavaScript in a ' – johnny 5 Jun 28 '17 at 12:35
  • Because I didn't understand what you said. Can you please give me an example? I'm a little bit confused. Thank you – Evil Str Jun 28 '17 at 16:54
  • I cannot give you an example because your question is already marked duplicate. But the answer is written in the duplicate question – johnny 5 Jun 28 '17 at 18:05

0 Answers0