2013-08-19 7 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.A0 메서드) ([browser support] (http://caniuse.com/history)). –

+0

간단한 javascript/jquery 함수로이를 수행하는 방법은 무엇입니까? –

답변

0

probably want to use ajax for this, jquery has a cool function that is pretty versatile:

http://api.jquery.com/load/

+0

이것은 url o.o를 변경하지 않습니다. –