I am a bit unclear as far as preprocessor directives, i.e. if I don’t want to manually change file locations in my scripts for iOS specific builds and or web builds to reference specific files OR web URL’s:
pseudo code:
files: #if (ios)
var URL=“mywebURL.com/fileName” #if (my_web_regular_apache_Server)
var URL ="(localhost)/fileName"
…
Preprocessor directives? Methinks you have a background in C++! So you have a couple of examples there: detecting if you’re running on iOS and detecting if you’ve running from a certain URL (localhost in the example you give). Let’s take them in turn.
For detecting if you’re running from localhost, check out this StackOverflow thread. So you’d essentially look for localhost in that window.location.href (or do a regex if you’re really thorough!)
Thanks!
Yup Borland C++, I don’t know what else to call them. Awesome!
…script compilation order is a bit grey to me as of this moment because I intentionally avoided web development for the last 10 years - I had dot.com PTSD.