Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function(){
- // Document is ready
- });
- jQuery(function($) {
- // Your code using failsafe $ alias here...
- });
- jQuery(function($) {
- $.getScript("http://www.yourdomain.com/scripts/somescript1.js");
- $.getScript("http://www.yourdomain.com/scripts/somescript2.js");
- });
- <html>
- <head>
- <title>Test Page</title>
- <script type="text/javascript">
- window.onload = function () {
- alert(document.getElementsByTagName("body")[0].className);
- };
- </script>
- <style type="text/css">
- .testClass { color: green; background-color: red; }
- </style>
- </head>
- <body class="testClass">
- <p>Test Content</p>
- </body>
- </html>
- <html>
- <head>
- <title>Test Page</title>
- <script type="text/javascript">
- alert("Are you seeing a blank page underneath this alert?");
- </script>
- <style type="text/css">
- .testClass { color: green; background-color: red; }
- </style>
- </head>
- <body class="testClass">
- <p>Test Content</p>
- </body>
- </html>
- if (!window.addOnLoad)
- {
- window.addOnLoad = function (f) {
- var o = window.onload;
- window.onload = function () {
- if (typeof o == "function") o();
- f();
- }
- };
- }
- window.addOnLoad(function () {
- alert(document.getElementsByTagName("body")[0].className);
- });
- dojo.addOnLoad(function () {
- alert(document.getElementsByTagName("body")[0].className);
- });
- $(function () {
- alert(document.getElementsByTagName("body")[0].className);
- });
- if (!window.addScript)
- {
- window.addScript = function (src, callback) {
- var head = document.getElementsByTagName("head")[0];
- var script = document.createElement("script");
- script.src = src;
- script.type = "text/javascript";
- head.appendChild(script);
- if (typeof callback == "function") callback();
- };
- }
- window.addOnLoad(function () {
- window.addScript("example.js");
- });
- dojo.addOnLoad(function () {
- dojo.require("dojo.io.script");
- dojo.io.script.attach("exampleJsId", "example.js");
- });
- $(function () {
- $.getScript("example.js");
- });
Add Comment
Please, Sign In to add comment