0

I have this website http://www.kdomestriha.cz/recenze-kadernicvi which basically shows list of hairdressers you searched for. When you enter one word term and search (you can try "Praha"), ajax update on pagination works perfectly fine. However if you try to enter two words (you can try Hradec Králové), pagination will refresh whole site. I am not sure, if showing all of my code helps... Does anyone have any clue what could be a cause of this strange behavior? Thanks

kokoseq
  • 209
  • 4
  • 11

2 Answers2

1

Since you didn't post any code, only way I got that looking your web source, and I point what wrong was in it.

If I searched by word "Praha", your web would generate following things:

<div id="Praha" class="list-view">....

After then in jQuery, you have code to access it through syntax:

$('#Praha').....

In order to achieve your own purpose, I think you used searching word as element id, it would caused the problem if you entered more one word into your filter, space character is not a valid for ID attribute in jQuery

 $('#Hradec Králové').. //failed

It did not raise any error, but it wouldn't work as you expected.

Community
  • 1
  • 1
Telvin Nguyen
  • 3,569
  • 4
  • 25
  • 39
0

If pagination is causing your site to refresh, the most likely cause is that something in the search/filter result is causing javascript error, thus causing yii to revert to full page refresh.

I'd advice that you look at your page in chrome's web inspector (cos that's what I use) after searching and confirm that the javascript isn't broken