Browse - programming tips - javascript includeDate: 2009oct15 Language: javaScript Q. How can I do a C-like #include in javaScript? A. There is no equivalent to a #include is javaScript. But you can use Ajax to pull in a .js file and then run it! Here's how to do that with jQuery: $.ajax({ type: 'GET', url: 'my_include.js', dataType: 'script' }); You can do this in pure javaScript too. Search for "Ajax" here for more info.
Add a commentSign in to add a comment |