2013-08-19 2 views
0

I have a div, which is in a link href tag:Как сообщить <a href..> not refresh the page

<a href="banana.html"><div id="somediv">Some Div</div></a> 

when I click on the div, the entire page unloads and reloads with banana.html. However, I'm using websocket and need only a part of the page to reload, is there a way to change the window url without refreshing the page?

Thanks!

+0

Читайте на AJAX. https://developer.mozilla.org/en/docs/AJAX –

+3

['history.pushState()'] (https://developer.mozilla.org/en-US/docs/Web/Guide/DOM/Manipulating_the_browser_history# The_pushState(). C2.A0method) ([поддержка браузера] (http://caniuse.com/history)). –

+0

есть ли способ сделать это с помощью простых функций javascript/jquery? –

ответ

Смежные вопросы