Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //No need to put inside $(document).ready
- $(document).on('click','a',function () {
- })
- // Need to put inside $(document).ready if placed inside <head></head>
- $('.container').on('click','a',function () {
- });
- $(document).ready(function() {
- console.log('ready!');
- });
- $(function() {
- console.log('ready!');
- });
- $(document).ready(function() {
- // Handler for .ready() called.
- });
- $(document).ready(function(){
- bindelement1();
- bindelement2();
- });
- function bindelement1(){
- $('el1').on('click',function...);
- //you might make an ajax call here, then under complete of the AJAX, call this function or any other function again
- }
- function bindelement2(){
- $('el2').on('click',function...);
- }
- <div id="advance-search">
- Some other DOM elements
- <!-- Here I wanted to apppend the link as <a href="javascript:;" id="reset-adv-srch"><span class="bold">x</span> Clear all</a>-->
- </div>
- <script>
- $("#advance-search #reset-adv-srch").on("click", function (){
- alert('Link Clicked');``
- });
- </script>
- $(document).ready(function(e) {
- $("#advance-search #reset-adv-srch").on("click", function (){
- alert('Link Clicked');
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement