<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Load a page with javascript</title>
	<atom:link href="http://www.javascriptkata.com/2008/02/12/load-a-page-with-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.javascriptkata.com/2008/02/12/load-a-page-with-javascript/</link>
	<description>Advanced katas for javascripters</description>
	<lastBuildDate>Fri, 30 Jul 2010 18:10:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: dustin</title>
		<link>http://www.javascriptkata.com/2008/02/12/load-a-page-with-javascript/comment-page-1/#comment-815</link>
		<dc:creator>dustin</dc:creator>
		<pubDate>Wed, 14 Oct 2009 15:50:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.javascriptkata.com/2008/02/12/load-a-page-with-javascript/#comment-815</guid>
		<description>switch (date(&#039;d&#039;)) {
    case &#039;01&#039;:
        include_once(&#039;page01.html&#039;);
        break;
    case &#039;02&#039;:
        include_once(&#039;page02.html&#039;);
        break;
    // etc...
}</description>
		<content:encoded><![CDATA[<p>switch (date(&#8216;d&#8217;)) {<br />
    case &#8217;01&#8242;:<br />
        include_once(&#8216;page01.html&#8217;);<br />
        break;<br />
    case &#8217;02&#8242;:<br />
        include_once(&#8216;page02.html&#8217;);<br />
        break;<br />
    // etc&#8230;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dustin</title>
		<link>http://www.javascriptkata.com/2008/02/12/load-a-page-with-javascript/comment-page-1/#comment-814</link>
		<dc:creator>dustin</dc:creator>
		<pubDate>Wed, 14 Oct 2009 15:47:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.javascriptkata.com/2008/02/12/load-a-page-with-javascript/#comment-814</guid>
		<description>The best way to handle this would probably be to use a server side scripting solution such as PHP. This would solve the problem of both users who have javascript disabled and search engine crawlers that are trying to index your site.

The way it would work is, when the page request is sent to the server, the server script would decide which content to load for that day. So in a file called index.php for example (if you have a PHP enabled web host), you would put something like.

</description>
		<content:encoded><![CDATA[<p>The best way to handle this would probably be to use a server side scripting solution such as PHP. This would solve the problem of both users who have javascript disabled and search engine crawlers that are trying to index your site.</p>
<p>The way it would work is, when the page request is sent to the server, the server script would decide which content to load for that day. So in a file called index.php for example (if you have a PHP enabled web host), you would put something like.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: camilou</title>
		<link>http://www.javascriptkata.com/2008/02/12/load-a-page-with-javascript/comment-page-1/#comment-455</link>
		<dc:creator>camilou</dc:creator>
		<pubDate>Sun, 02 Mar 2008 22:17:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.javascriptkata.com/2008/02/12/load-a-page-with-javascript/#comment-455</guid>
		<description>&quot;javascript should not be a requirement to navigate in a site.&quot;

Quite true, sir. All the time I have to remember people around me that Javascript is mean to be some sort of &quot;add-on&quot; to the features on one website. Even though almost anyone has javascript enabled, we still can&#039;t trust all the functionality into the scripts. This is one big mistake people made all the time.</description>
		<content:encoded><![CDATA[<p>&#8220;javascript should not be a requirement to navigate in a site.&#8221;</p>
<p>Quite true, sir. All the time I have to remember people around me that Javascript is mean to be some sort of &#8220;add-on&#8221; to the features on one website. Even though almost anyone has javascript enabled, we still can&#8217;t trust all the functionality into the scripts. This is one big mistake people made all the time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olivier D. alias ze kat</title>
		<link>http://www.javascriptkata.com/2008/02/12/load-a-page-with-javascript/comment-page-1/#comment-450</link>
		<dc:creator>Olivier D. alias ze kat</dc:creator>
		<pubDate>Wed, 13 Feb 2008 18:06:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.javascriptkata.com/2008/02/12/load-a-page-with-javascript/#comment-450</guid>
		<description>It&#039;s possible to do it by another way... Follow my eyes :o&quot;</description>
		<content:encoded><![CDATA[<p>It&#8217;s possible to do it by another way&#8230; Follow my eyes <img src='http://www.javascriptkata.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> &#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gill</title>
		<link>http://www.javascriptkata.com/2008/02/12/load-a-page-with-javascript/comment-page-1/#comment-444</link>
		<dc:creator>Gill</dc:creator>
		<pubDate>Tue, 12 Feb 2008 19:23:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.javascriptkata.com/2008/02/12/load-a-page-with-javascript/#comment-444</guid>
		<description>The .toString() isn&#039;t required in JavaScript. as soon as you try to do:

String + Int + String;

The browser will convert the number for you.


However you are correct. JavaScript is not the best tool for this.  I would use whatever serverside language tools you have.

var day = SSLang.getDate();
SSLang.include( &quot;page&quot; + day + &quot;.ext&quot; );

This way you can include whatever content you want, and still have global items on the page... the URL doesn&#039;t change (because if the user bookmarks the 17th, they will always see the 17th, and will never get the redirection)

Cheers!</description>
		<content:encoded><![CDATA[<p>The .toString() isn&#8217;t required in JavaScript. as soon as you try to do:</p>
<p>String + Int + String;</p>
<p>The browser will convert the number for you.</p>
<p>However you are correct. JavaScript is not the best tool for this.  I would use whatever serverside language tools you have.</p>
<p>var day = SSLang.getDate();<br />
SSLang.include( &quot;page&quot; + day + &quot;.ext&quot; );</p>
<p>This way you can include whatever content you want, and still have global items on the page&#8230; the URL doesn&#8217;t change (because if the user bookmarks the 17th, they will always see the 17th, and will never get the redirection)</p>
<p>Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Load a page with javascript &#171; Java Net</title>
		<link>http://www.javascriptkata.com/2008/02/12/load-a-page-with-javascript/comment-page-1/#comment-443</link>
		<dc:creator>Load a page with javascript &#171; Java Net</dc:creator>
		<pubDate>Tue, 12 Feb 2008 16:19:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.javascriptkata.com/2008/02/12/load-a-page-with-javascript/#comment-443</guid>
		<description>[...] a page with javascript  This entry was written by Dan Simard. Bookmark the permalink. Follow any comments here with the RSS feed for this post.Content related [...]</description>
		<content:encoded><![CDATA[<p>[...] a page with javascript  This entry was written by Dan Simard. Bookmark the permalink. Follow any comments here with the RSS feed for this post.Content related [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
