<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JavaScript &#8211; Kerem ER</title>
	<atom:link href="https://kkerem.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>https://kkerem.com</link>
	<description>Web Geliştiricisi</description>
	<lastBuildDate>Sat, 22 Jun 2024 21:54:38 +0000</lastBuildDate>
	<language>tr-TR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://kkerem.com/wp-content/uploads/favicon-1-150x150.png</url>
	<title>JavaScript &#8211; Kerem ER</title>
	<link>https://kkerem.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to change URL query parameter with Javascript</title>
		<link>https://kkerem.com/how-to-change-url-query-parameter-with-javascript/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sat, 22 Oct 2022 15:51:02 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[JavaScript]]></category>
		<guid isPermaLink="false">http://localhost/kerem/?p=187</guid>

					<description><![CDATA[URL query parameters can be easily modified using URLSearchParams and History interfaces: // Construct URLSearchParams object instance from current URL querystring. var queryParams = new URLSearchParams(window.location.search); Set new or modify existing parameter value. queryParams.set("myParam", "myValue"); // Replace current querystring with the new one. history.replaceState(null, null, "?"+queryParams.toString()); Alternatively instead of modifying current history entry using replaceState() we can use pushState() method to create a [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>URL query parameters can be easily modified using <a href="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams">URLSearchParams</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/API/History_API">History</a> interfaces:</p>
<pre><code class="language-javascript hljs"><span class="hljs-comment">// Construct URLSearchParams object instance from current URL querystring.</span>
<span class="hljs-keyword">var</span> queryParams = <span class="hljs-keyword">new</span> <span class="hljs-title class_">URLSearchParams</span>(<span class="hljs-variable language_">window</span>.<span class="hljs-property">location</span>.<span class="hljs-property">search</span>);
<span class="hljs-title class_">Set</span> <span class="hljs-keyword">new</span> or modify existing parameter value. queryParams.<span class="hljs-title function_">set</span>(<span class="hljs-string">"myParam"</span>, <span class="hljs-string">"myValue"</span>);
<span class="hljs-comment">// Replace current querystring with the new one.</span>
history.<span class="hljs-title function_">replaceState</span>(<span class="hljs-literal">null</span>, <span class="hljs-literal">null</span>, <span class="hljs-string">"?"</span>+queryParams.<span class="hljs-title function_">toString</span>());</code></pre>
<p>Alternatively instead of modifying current history entry using <a href="https://developer.mozilla.org/en-US/docs/Web/API/History_API#The_replaceState()_method">replaceState()</a> we can use <a href="https://developer.mozilla.org/en-US/docs/Web/API/History_API#The_pushState()_method">pushState()</a> method to create a new one:</p>
<pre><code class="language-javascript hljs">history.<span class="hljs-title function_">pushState</span>(<span class="hljs-literal">null</span>, <span class="hljs-literal">null</span>, <span class="hljs-string">"?"</span>+queryParams.<span class="hljs-title function_">toString</span>());</code></pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
