I am writing a dynamic webpage that is compiled and dynamically loaded using a C program. I have been writing the code by using:
printf ("<p><h1>Hello world!</h1></p>\n");
I want to add jQuery to the file, so the first thing I did was was a leader back slash to all quotes:
"Text here" becomes \"Text here\"
Now this leaves two problems:
1 - In the JS file, the original code looks like this:
*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*
And after the " correction is made looks like this (this is just a sample extract of code):
*(?:(['\\"])((?:\\\\.|[^\\\\])*?)\\3|(\"+O+\")|)|)\"+_+\"*
But a lot of this code is not greyed out (as it should be as I want just the contents of the line printed so the browser knows what to do). I have added some additional \s and made it grey - this appears to work, but still produces some compiling errors.
2 - When I attempt to compile, there are characters (such as \t , \r and /) that are not recongised by the compiler - how can I ensure that these are considered part of the javascript code?
Any help with this would be greatly appreciated.