0

I have a function in jquery called navigation which is called once the page is loaded.

$(document).ready(function(){
   navigation();
 });

the function definition is global. This function is again called on an ajax success function

var onSuccess=function(data){
    //unbind the previous navigation
   navigation();
  }

How do i unbind the previous navigation function so that the call on onSuccess is a new call

1 Answers1

0

For what you're asking deleting a global property and specifically the link given there: http://perfectionkills.com/understanding-delete/ will help you understand why what you want is not possible (or really akward, you need to read the linked text for the full story).

That makes me agree with @FabrícioMatté - you really, really want to rework your navigation function to keep track of what it loaded so you can just call it again and have it work out where to go next. There's no reason I can think of to redefine the function.

Community
  • 1
  • 1
mabi
  • 5,279
  • 2
  • 43
  • 78