onfocus stop work after reload content in parent object
I load content to the using AJAX. in content you can find this line of code:
<input onfocus='searchItems("sContainer", this)' onblur='searchItemsStop()'/>
first time when I load the content onfocus
and onblur
events works. But when I reload the content onfocus
and onblur
stop working.
in firebug I noticed that for every reload of content onfocus
and onblur
events start to duplicating.
how can i solve this?
EDIT:
the loaded content is a table with list of products. I load this into popup div on user button click.
the searchItems check the input for user query, and show in the list only products which match to the query.
When开发者_开发知识库 user close popup, all content is removed by .removeChild
, so why the events are not deleted with the content too?
The problem was in different place that i watched.
searchItems
function was using referance only to the first (deleted later) input element.
Problem solved.
精彩评论