Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript" src="file1.js"></script>
- <script type="text/javascript" src="file2.js"></script>
- function primary()
- {
- secondary();
- }
- function secondary()
- {
- alert("hi primary");
- }
- <html>
- <head>
- <script src=script1.js></script>
- <script src=script2.js></script>
- </head>
- <body>
- </body>
- </html>
- secondary();
- secondary();
- <html>
- <head>
- <script src=script1.js defer></script>
- <script src=script2.js></script>
- </head>
- <body>
- </body>
- </html>
- $.getScript("file1.js",function(){
- alert("File1.js is loaded");
- }
- File1 = function(){
- }
- File1.prototype=
- {
- constructor:File1,
- primary:function()
- {
- if (File2 == "undefined")
- {
- $.getScript("file2.js",function()
- {
- file2 = new File2();
- file2.secondary();
- });
- }
- }
- }
- File2 = function(){
- }
- File2.prototype=
- {
- constructor:File2,
- secondary:function()
- {
- if (File1 == "undefined")
- {
- $.getScript("file1.js",functiom()
- {
- file1 = new File1();
- file1.primary();
- });
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement