optimize function

1.optimize function about search content by javascript
2.fixed javascript error