javascript - Is it possible to include the comment in a comment by using JS or other PL? -


is possible include comment in comment using other languages? condition i'am building static website, need avoid using php.

i know has been asked already, , it here. answer states need use version control, answer on year 2011. question the same here , says not possible in html, answer on year 2012. there other methods out there? it's 2015, maybe can achieve using js?

i use in situation can make sources online (if have internet) , offline (if don't have internet).

sample code:

<!-- offline sources -->  <script type="text/javascript" src="javascripts/javapreloadjs-0.4.1.min.js"></script> <!-- preloadjs-0.4.1.min.js --> <script type="text/javascript" src="javascripts/bitmapdata-1.0.2.min.js"></script> <!-- bitmapdata-1.0.2.min.js --> <script type="text/javascript" src="javascripts/vector3d-1.2.0.min.js"></script> <!-- vector3d-1.2.0.min.js --> <script type="text/javascript" src="javascripts/stats.js"></script> <!-- stats.min.js --> <script type="text/javascript" src="javascripts/break-image.js"></script> <!-- break image end -->    <!-- online sources -->  <!--  <script type="text/javascript" src="http://jsrun.it/assets/o/w/w/d/owwdc"></script> <!-- preloadjs-0.4.1.min.js --> <script type="text/javascript" src="http://jsrun.it/assets/t/c/4/c/tc4ct"></script> <!-- bitmapdata-1.0.2.min.js --> <script type="text/javascript" src="http://jsrun.it/assets/i/d/o/f/idofr"></script> <!-- vector3d-1.2.0.min.js --> <script type="text/javascript" src="http://jsrun.it/assets/3/n/9/c/3n9cy"></script> <!-- stats.min.js --> <script type="text/javascript" src="http://jsrun.it/assets/j/l/j/z/jljzs"></script> <!-- break image end -->  --> 

notice comment code

 <!--  <script type="text/javascript" src="http://jsrun.it/assets/o/w/w/d/owwdc"></script> <!-- preloadjs-0.4.1.min.js --> 

because html thinks first --> end of comment.

there situation i'am debugging code has lots of comment trying explain , want comment block of codes can try something.

like this

<!-- temporary comment can play portion of code <!-- header part --> <h1> sample header</h1><!-- header --> <!-- end of header --> -->   <!-- header part --> <h1>now can want code while leaving comment of portion of code!</h1><!-- header --> <!-- end of header --> 

i'm guessing want because 1 set of conditions should import 1 thing vs another. think javascript best tool anyway, if could use plain html (which can't, because comments can't nested in html).

you can load set of script dynamically, based on whatever conditions need met: http://api.jquery.com/jquery.getscript/

or roll own (if you're jquery-averse) running xmlhttprequest , executing script.


Comments

Popular posts from this blog

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -