<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; Смена адреса страницы]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=9142</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=9142&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «Смена адреса страницы».]]></description>
		<lastBuildDate>Mon, 13 Jan 2014 06:03:13 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Смена адреса страницы]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=79138#p79138</link>
			<description><![CDATA[<p>может есть какой-то другой способ изменить url в адресной строке без перезагрузки страницы?</p>]]></description>
			<author><![CDATA[null@example.com (valentinka.solar)]]></author>
			<pubDate>Mon, 13 Jan 2014 06:03:13 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=79138#p79138</guid>
		</item>
		<item>
			<title><![CDATA[Смена адреса страницы]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=79134#p79134</link>
			<description><![CDATA[<p>Доброго времени суток. Нужно сделать изменение url страницы без ее перезагрузи и не используя #hash. Пытаюсь разобрать пример найденные на просторах интернета <br /></p><div class="codebox"><pre><code>
&lt;a href=&quot;/three/&quot; onclick=&quot;followLink(event, this)&quot;&gt;третья страница&lt;/a&gt;
 
&lt;script type=&quot;text/javascript&quot;&gt;
 
function followLink(event, link)
{
    var nameLink = link.innerHTML;
    uploadContent(link.href);
    history.pushState({title:nameLink, href:link.href}, null, link.href);
    updateTitle(nameLink);
    event.preventDefault();
}
 
function updateTitle(title)
{
    var elm = document.getElementsByTagName(&#039;title&#039;)[0];
    elm.innerHTML = title;
}
 
function uploadContent(link)
{
    //тут реализуем загрузку части страницы с помощью AJAX
}
 
window.addEventListener(&quot;popstate&quot;, function(e) {
    uploadContent(e.state.href);                                     
    updateTitle(e.state.title);
}, false );
 
&lt;/script&gt;
 
&lt;/body&gt;
&lt;/html&gt;
</code></pre></div><p>Но в консоле появляется ошибка Uncaught TypeError: Cannot read property &#039;href&#039; of null. Судя по всему window.addEventListener не видит href, но я не могу понять в чем причина</p>]]></description>
			<author><![CDATA[null@example.com (valentinka.solar)]]></author>
			<pubDate>Sun, 12 Jan 2014 17:49:43 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=79134#p79134</guid>
		</item>
	</channel>
</rss>
