Why ajax submit refreshed my whole page?

Why ajax submit refreshed my whole page?

I just want to add a button to collapse/expand my show items in the table. now I chage the button appearance by javascript and then I do the ajax submit to refresh the table records. then I see that the whole page is refreshing , after that, The appearance of the button back to default . so, can anybody tell the reason ? thank a lot ! 

please proviode the oml so we can see what is happening.
Now we only can guess...

sorry for that , I can't provide the oml, for that not my personal project.
So , I just want to ask :
     I need to use Ajax Submit to refresh a table. and this action will be triggered by a button outside of the table. now I add the ajax refresh in the screen action which the button linked .  when I clicked the button , I found that the whole page is refreshed,  It was confusing... , In the Extended Properties , I set the onclick event and use the javascript code to change the button's value , but when the page refreshed , these changes be invalid . So can you please help me to think which mistake may happened according to your exprience , thanks!

Have you set the buttons' method to Ajax Submit? Check this help page decribing the different Methods.
Hi Jie,

I can actually think in a lot of different things that can be wrong, but it will be hard to explain and throubleshoot it like this.

Like J said it will be very easy if you provide a sample. It doensn't need to be your Module, just create an empty one and copy paste the table, button and necessary javasctipt code to it. It can even have dummy data just as an example.

João Rosado
Deleted my previous post. It turned out to be my own fault after all :). There was a return statement in the function, which caused the OsAjax not to be executed.