<?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>World Wide What?</title>
	<atom:link href="http://www.worldwidewhat.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.worldwidewhat.net</link>
	<description>Exploring New Web Technologies</description>
	<lastBuildDate>Fri, 16 Mar 2012 09:03:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Firefox 11 Introduces 3D Web Inspection</title>
		<link>http://www.worldwidewhat.net/2012/03/firefox-11-introduces-3d-web-inspection/</link>
		<comments>http://www.worldwidewhat.net/2012/03/firefox-11-introduces-3d-web-inspection/#comments</comments>
		<pubDate>Fri, 16 Mar 2012 09:03:33 +0000</pubDate>
		<dc:creator>lasse</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://www.worldwidewhat.net/?p=736</guid>
		<description><![CDATA[The new Firefox 3D View for Developers allows you to inspect your web page&#8217;s layers in a 3D view to see the underlying div etc. which can be hard to detect and select otherwise. It uses WebGL to render your page in the browser and allows you to twist and turn your web page as [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-736"></span><!--noteaser--></p>
<p>
The new Firefox 3D View for Developers allows you to inspect your web page&#8217;s layers in a 3D view to see the underlying div etc. which can be hard to detect and select otherwise.</p>
<p>It uses WebGL to render your page in the browser and allows you to twist and turn your web page as you like.
</p>
<p>
To try it out; click on your Firefox menu and select <i>Inspect</i> under the <i>Web Developer</i> entry. Then click on the <i>3D (M)</i> button in the developer toolbar at the bottom.
</p>
<p><a href="http://www.worldwidewhat.net/wp-content/uploads/2012/03/3d.png"><img src="http://www.worldwidewhat.net/wp-content/uploads/2012/03/3d.png" alt="" title="3d" width="300" height="229" class="aligncenter size-full wp-image-741" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldwidewhat.net/2012/03/firefox-11-introduces-3d-web-inspection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatically Load New Rows When Reaching Page End</title>
		<link>http://www.worldwidewhat.net/2012/01/automatically-load-new-rows-when-reaching-page-end/</link>
		<comments>http://www.worldwidewhat.net/2012/01/automatically-load-new-rows-when-reaching-page-end/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 13:55:14 +0000</pubDate>
		<dc:creator>lasse</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.worldwidewhat.net/?p=669</guid>
		<description><![CDATA[The normal way to handle long lists and tables are to implement paging, paging is very useful and practical when it comes to handling a lot of tabular data. But it might not always be the most intuitive way to handle lists and timelines. This is where dynamic row fetching comes to play and in [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-669"></span><!--noteaser--></p>
<p>
The normal way to handle long lists and tables are to implement paging, paging is very useful and practical when it comes to handling a lot of tabular data. But it might not always be the most intuitive way to handle lists and timelines. This is where dynamic row fetching comes to play and in this article I will show you how to implement it in ASP.NET.
</p>
<p>
Dynamic row fetching is quite simple and works like this; When you first enter the page it automatically loads the first, for instance, 20 rows, this could be the equivalent of page one in a regular table. When the user had read the rows and scrolled to the bottom of the page another 10 rows are loaded and appended to the bottom of the list making it longer, this is the equivalent page 2. And when the user reaches the bottom again another 10 rows are loaded and so on until all rows has been loaded.
</p>
<p>
If you don&#8217;t follow my explanation, just head over to your favorite twitter feed, for instance <a href="https://twitter.com/#!/World_Wide_What">@World_Wide_What</a>, and scroll to the bottom of the page and you&#8217;ll see what I mean.
</p>
<p>
There is one issue with this technology though, you can&#8217;t have anything else below the the list if you want to keep usability. Cause if your visitor tries to read information below the list he or she needs to scroll to the bottom of the page which will cause the list to load new rows. This will result in that the information your visitor is trying to read gets pushed down and outside the browser window making it impossible or at least hard to read.
</p>
<p>
Well, enough with all the boring mumbo jumbo, let&#8217;s do some coding.
</p>
<h2>Step 1. The Server Side Code</h2>
<p>
In this example I will use my twitter timeline as the data source for my data, but you can use whatever you like, such as a SQL database or RSS feed.
</p>
<p>
Create a new project in Visual Studio of the type <i>ASP.NET Empty Web Application</i>. Add a new Web Form to your project named <i>Default.aspx</i> and a class named <i>Response.cs</i>.
</p>
<p>
The <i>Response.cs</i> will contain two classes, <i>Tweet</i> which will contain the data related to every tweet, such as <i>Author</i>, <i>Created</i> and <i>Message</i> and the <i>Response</i> class which will contain a <i>List<Tweet></i> containing every tweet within the range we&#8217;d return to our page. It will also contain <i>ReachedEnd</i> which is a boolean telling us if all tweets has been loaded.
</p>
<pre class="brush: csharp; title: ; notranslate">
public class Response
{
    /// &lt;summary&gt;
    /// True if all tweets has been loaded
    /// &lt;/summary&gt;
    public bool ReachedEnd { get; set; }

    /// &lt;summary&gt;
    /// The tweets loaded
    /// &lt;/summary&gt;
    public List&lt;Tweet&gt; Tweets { get; set; }
}

public class Tweet
{
    /// &lt;summary&gt;
    /// Date and time tweet was posted
    /// &lt;/summary&gt;
    public DateTime Created { get; set; }

    /// &lt;summary&gt;
    /// The author of the tweet
    /// &lt;/summary&gt;
    public string Author { get; set; }

    /// &lt;summary&gt;
    /// The tweet itself
    /// &lt;/summary&gt;
    public string Message { get; set; }
}
</pre>
<p>
Now that we have the class that will contain the response it&#8217;s time to create our web method. The following code goes into your Default.aspx.cs file.
</p>
<pre class="brush: csharp; title: ; notranslate">
/// &lt;summary&gt;
/// Gets the tweets in the selected range from the server
/// &lt;/summary&gt;
[WebMethod]
public static object GetPosts(int skip, int take)
{
    List&lt;Tweet&gt; tweets = Twitter.GetTweets();

    var toDisplay = from t in tweets.Skip(skip).Take(take)
                    select t;

    return new Response {
        ReachedEnd = tweets.Count &lt;= skip + take,
        Tweets = toDisplay.ToList&lt;Tweet&gt;()
    };
}
</pre>
<p>
First we need to get all the tweets from our twitter timeline, this can be replaced with whatever data source you like, such as you SQL Server. I won&#8217;t explain this function in detail as it isn&#8217;t a part of the tutorial but you have the code below.
</p>
<p>
Next we&#8217;ll use a Linq query filter out the tweets we&#8217;d like to return. The skip parameter tells Linq how many tweets we want to skip before getting the tweets we want to show and the take is how many we would like to return. These parameter are sent from the JavaScript function which we&#8217;re going to create later on.
</p>
<p>
Then we create a new instance of the Response class which we created earlier and if the total number of tweets in our timeline is less or equal to the sum of the skip and take we&#8217;ve reached the end of our timeline. Otherwise there&#8217;s more rows to show when the user scrolls further down. The <i>Tweets</i> property is set to the result of our Linq question.
</p>
<p>This is the code for the GetTweets() function which is used to fetch tweets from your favorite timeline. I thought it was nice to share the code but won&#8217;t explain this code for your though, since it isn&#8217;t a part of the tutorial.</p>
<pre class="brush: csharp; title: ; notranslate">
private const string twitterUrl = &quot;http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=World_Wide_What&amp;count=1000&amp;include_rts=true&quot;;

public static List&lt;Tweet&gt; GetTweets()
{
    HttpWebRequest twitterRequest = (HttpWebRequest)WebRequest.Create(twitterUrl);
    List&lt;Tweet&gt; tweets = new List&lt;Tweet&gt;();

    XDocument twitterResponse = XDocument.Load(twitterRequest.GetResponse().GetResponseStream());

    foreach (XElement tweet in twitterResponse.Descendants(&quot;status&quot;))
    {
        tweets.Add(new Tweet
        {
            Author = tweet.Elements(&quot;user&quot;).Elements(&quot;screen_name&quot;).First().Value,
            Created = DateTime.ParseExact(tweet.Element(&quot;created_at&quot;).Value, &quot;ddd MMM dd HH:mm:ss zzz yyyy&quot;, CultureInfo.InvariantCulture),
            Message = tweet.Element(&quot;text&quot;).Value
        });
    }

    return tweets;
}
</pre>
<p>
That&#8217;s it, nothing else is required on the server side, simple and clean.
</p>
<h2>Step 2. The HTML</h2>
<p>
Now it&#8217;s time to create our client side code, open up your default.aspx and write the following HTML.
</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!DOCTYPE html&gt;

&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;Dynamic Row Fetcher&lt;/title&gt;

        &lt;script src=&quot;http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js&quot;&gt;
        &lt;/script&gt;
        &lt;script&gt;
        &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;form id=&quot;frmMain&quot; runat=&quot;server&quot;&gt;
        &lt;div id=&quot;main&quot;&gt;
            &lt;h1&gt;Dynamic Row Fetcher&lt;/h1&gt;
            &lt;p&gt;Showing twitter posts from @World_Wide_What&lt;/p&gt;
            &lt;div id=&quot;feed&quot;&gt;
            &lt;/div&gt;
            &lt;div id=&quot;loading&quot;&gt;
                Loading tweets...
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;/form&gt;
    &lt;/body&gt;
&lt;/html&gt;
</pre>
<p>
Most of it is quite self explanatory, There&#8217;s no stylesheet in the example above so it will look awful but you can download it together with the rest of the code by clicking the link in the bottom of the article.
</p>
<p>
We&#8217;ll use jQuery to make things easier and the script tag will contain all the JavaScript we need to write for this to work. The <i>feed</i> div will be the container for our posts and the <i>loading</i> will notify the user that we&#8217;re currently loading tweets.
</p>
<h2>Step 3. Our JavaScript</h2>
<p>
Next it&#8217;s time to create our JavaScript, all the code below will go into the empty script tag we created in the previous step.
</p>
<pre class="brush: jscript; title: ; notranslate">
var isLoading = false;
var skip = 0, take = 20;

function loadTweets() {
    isLoading = true;

    $.ajax({
        type: 'POST',
        url: &quot;Default.aspx/GetPosts&quot;,
        data: '{ &quot;skip&quot; : ' + skip + ', &quot;take&quot; : ' + take + ' }',
        contentType: &quot;application/json; charset=utf-8&quot;,
        dataType: &quot;json&quot;,
        success: function (msg) {
            for (var i = 0; i &lt; msg.d.Tweets.length; i++) {
                appendTweet(msg.d.Tweets[i]);
            }

            if (msg.d.ReachedEnd) {
                $('#loading').html('&lt;a href=&quot;#main&quot;&gt;Back to top&lt;/a&gt;');
            }
            else {
                skip += msg.d.Tweets.length;
                take = 10;
                isLoading = false;
            }
        }
    });
}
</pre>
<p>
This is the <i>loadTweets()</i> function, it will make a request to the server using AJAX and handle the response. The for loop loops through the tweets returned in our list inside the <i>Response</i> class created earlier in the code behind. It calls the <i>appendTweet</i> to add them to our page, which we&#8217;ll create later on.
</p>
<p>
Next we check the <i>ReachedEnd</i> boolean to see if there&#8217;s more tweets to load or if everything is loaded. If everything is loaded we replace the &#8220;Loading&#8230;&#8221; text with a link for the user to go back to the top of the page. We&#8217;ll keep the isLoading as false to prevent our AJAX function from trying to load new rows.
</p>
<p>
If we haven&#8217;t reached the end we&#8217;ll increase the skip to the number of tweets loaded so we won&#8217;t load the same tweets twice. We also change the take to 10, this will result in that where loading 20 tweets on page load and then another 10 each time the user scrolls to the bottom of the page. Last but not least we set <i>isLoading</i> to false to allow new tweets to be loaded.
</p>
<div class="tip">
<h3>Tip</h3>
<p>Firebug is a really powerful add on for Firefox to debug and inspect the JSON response from the server.<br/><a href="http://www.softwareishard.com/blog/firebug/json-explorer-for-firebug/">Here&#8217;s an article on how to inspect AJAX an JSON responses.</a>
</div>
<p>
For our tweets to show up on the page we need to create the <i>appendTweet</i> function, it will look like this.
</p>
<pre class="brush: jscript; title: ; notranslate">
function appendTweet(data) {
    var tweet = $('&lt;div&gt;');

    var header = $('&lt;h2&gt;');
    header.html(data.Author + ' &lt;span class=&quot;light&quot;&gt;' + formatDate(data.Created) + '&lt;/span&gt;');

    var message = $('&lt;p&gt;');
    message.html(data.Message);

    tweet.append(header);
    tweet.append(message);

    $('#feed').append(tweet);
}

function formatDate(jsonDate) {
    var parsedDate = new Date(parseInt(jsonDate.substr(6)));
    var monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];

    return parsedDate.getDate() + ' ' + monthNames[parsedDate.getMonth()];
}
</pre>
<p>
First we create the container div, then we create the header which will contain the author and date the tweet was posted. Since JSON dates are formatted as &#8220;/Date(1224043200000)/&#8221; which isn&#8217;t very user friendly we need to write a small helper function to format it properly.
</p>
<p>
Next we create a paragraph and appends the message to it then we take our newly created <i>header</i> and <i>message</i> and appends it to the tweet which we&#8217;ll append to the bottom of our feed.
</p>
<p>
The <i>formatDate</i> takes our JSON date and converts it to a JavaScript date object which we use to get the month and date and then we show in the format &#8220;dd MMM&#8221;, &#8220;5 Jan&#8221; for instance.
</p>
<div class="tip">
<h3>Tip</h3>
<p>Creating the HTML manually using jQuery works fine in this example but i might be tedious with a more complex HTML structure. jTemplates is an awesome jQuery plugin to make this easier for you.<br/><a href="http://jtemplates.tpython.com/">Check it our here</a>.
</p>
</div>
<p>Almost there, the last bit is load the 20 first tweets and append an event that fires when the user scrolls the page.</p>
<pre class="brush: jscript; title: ; notranslate">
$(document).ready(function () {
    loadTweets();

    $(window).scroll(function () {
        // Start loading when 200px from the bottom
        if ($(window).scrollTop() + $(window).height() &gt; $('#main').height() - 200 &amp;&amp; !isLoading) {
            loadTweets();
        }
    });
});
</pre>
<p>
When the document has finished loading the <i>ready</i> event will be fired, this calls the loadTweets function to load the first page.
</p>
<p>
Next we&#8217;ll append a scroll even handler on the browsers window. Inside the event we add a condition to check if the user is 200px from the bottom of the feed and if we&#8217;re not currently loading new posts. If that is true we&#8217;ll call the <i>loadTweets</i> function to load new tweets.
</p>
<h2>Step 4. Try it out</h2>
<p>
Now were finished, it&#8217;s time to try it out build and execute the code the check the result. You can also try my example below if you&#8217;re lazy and just skipped to the end. You will also find a download link for the complete example below.
</p>
<div class="preview">
<h3>Example</h3>
<p>Try out the finished example here: <a href="http://www.worldwidewhat.net/extras/automatically-load-new-rows/example/Default.aspx" target="_blank">Example</a>.</p>
</div>
<div class="download">
<h3>Download</h3>
<p>Download the source from here: <a href="http://www.worldwidewhat.net/extras/automatically-load-new-rows/dynamic-row-fetcher.zip">Download</a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.worldwidewhat.net/2012/01/automatically-load-new-rows-when-reaching-page-end/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Speed up your jQuery by Replacing .live() with .on()</title>
		<link>http://www.worldwidewhat.net/2011/12/speed-up-your-jquery-by-replacing-live-with-on/</link>
		<comments>http://www.worldwidewhat.net/2011/12/speed-up-your-jquery-by-replacing-live-with-on/#comments</comments>
		<pubDate>Sun, 11 Dec 2011 17:15:02 +0000</pubDate>
		<dc:creator>lasse</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Live]]></category>
		<category><![CDATA[Off]]></category>
		<category><![CDATA[On]]></category>

		<guid isPermaLink="false">http://www.worldwidewhat.net/?p=650</guid>
		<description><![CDATA[The live() is really practical since you don&#8217;t need to reattach it when adding new objects and since that it&#8217;s also widely used. But it&#8217;s not very efficient and has a few issues. Two new functions where added to jQuery 1.7 to replace the live() function, they are the on() and the off() functions. As [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-650"></span><!--noteaser--></p>
<p>
The <i>live()</i> is really practical since you don&#8217;t need to reattach it when adding new objects and since that it&#8217;s also widely used. But it&#8217;s not very efficient and has a few issues. Two new functions where added to jQuery 1.7 to replace the <i>live()</i> function, they are the <i>on()</i> and the <i>off()</i> functions. As you can image they <i>on()</i> function adds an event handler and the <i>off()</i> function removes it.
</p>
<p>
One issue with the live event is that it will always look through the entire document, even if you&#8217;re only interested to catch events inside a certain element. With the <i>on()</i> event you can specify the area you wish to handle events in, like this:
</p>
<pre class="brush: xml; title: ; notranslate">
&lt;html&gt;
	&lt;head&gt;
		$('#container').on('click', 'a', function() {
			alert('HI!');
		});
	&lt;/head&gt;
	&lt;body&gt;
		&lt;a href=&quot;#&quot;&gt;Some other link&lt;/a&gt;
		&lt;div id=&quot;container&quot;&gt;
			&lt;a href=&quot;#&quot;&gt;Say hi!&lt;/a&gt;
		&lt;/div&gt;
	&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>
The code above will show an alert when clicking a link inside the <i>container</i> div but not on events outside.
</p>
<div class="tip">
<h3>More information</h3>
<p>You can check out the performance increase and write your own tests here: <a href="http://jsperf.com/live-vs-on">http://jsperf.com/live-vs-on</a></p>
</div>
<p>This was just just a short tip, if you want more information about the events check out this <a href="http://www.jquery4u.com/jquery-functions/on-vs-live-review/">very informative article</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldwidewhat.net/2011/12/speed-up-your-jquery-by-replacing-live-with-on/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firefox 10 Will Come with Native Developer Tools</title>
		<link>http://www.worldwidewhat.net/2011/11/firefox-10-will-come-with-native-developer-tools/</link>
		<comments>http://www.worldwidewhat.net/2011/11/firefox-10-will-come-with-native-developer-tools/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 18:55:38 +0000</pubDate>
		<dc:creator>lasse</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Developer Tools]]></category>
		<category><![CDATA[Firebug]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://www.worldwidewhat.net/?p=639</guid>
		<description><![CDATA[Firefox has announced that they will develop a native developer tools for Firefox 10 which will be release January 31st, 2012. Currently most developers are using the aww so wonderful Firebug to debug their web sites on Firefox so it will be interesting to see if Firefox own developer tools will match the power of [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-639"></span><!--noteaser--></p>
<p>
Firefox has announced that they will develop a native developer tools for Firefox 10 which will be release January 31st, 2012.
</p>
<p>
Currently most developers are using the aww so wonderful Firebug to debug their web sites on Firefox so it will be interesting to see if Firefox own developer tools will match the power of Firebug when released.
</p>
<p>
Anyway, you can check it out in further detail <a href="http://hacks.mozilla.org/2011/11/developer-tools-in-firefox-aurora-10/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldwidewhat.net/2011/11/firefox-10-will-come-with-native-developer-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change Browser-URL Without Refreshing Page</title>
		<link>http://www.worldwidewhat.net/2011/11/change-browser-url-without-refreshing-page/</link>
		<comments>http://www.worldwidewhat.net/2011/11/change-browser-url-without-refreshing-page/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 18:42:18 +0000</pubDate>
		<dc:creator>lasse</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[pushState]]></category>

		<guid isPermaLink="false">http://www.worldwidewhat.net/?p=617</guid>
		<description><![CDATA[Normally when you change the URL in the address bar the browser reloads the page. This seems and is a normal behavior for your browser but it has also been an issue when using AJAX while trying to keep the back button working. So far people has been using the the hashtag to do this, [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-617"></span><!--noteaser--></p>
<p>
Normally when you change the URL in the address bar the browser reloads the page. This seems and is a normal behavior for your browser but it has also been an issue when using AJAX while trying to keep the back button working. So far people has been using the the hashtag to do this, but now a better way exists.
</p>
<p>
The new solution to this is HTML5 or more exactly the window.history.pushState function, which does exactly what it sounds like, it pushes a page state to your browser&#8217;s history.
</p>
<p>
Here&#8217;s an example of the pushState function:
</p>
<pre class="brush: jscript; title: ; notranslate">
window.history.pushState(object, &quot;Title&quot;, &quot;http://worldwidewhat.net/url&quot;);
</pre>
<p>
This will change the URL in the address bar to &#8220;http://worldwidewhat.net/url&#8221; but it won&#8217;t redirect you to the page or even check if it actually exists. The function has three parameters:
</p>
<ul>
<li><b>State object</b> &#8211; This is an optional object you can associate with the state that is being pushed to the history.</li>
<li><b>Title</b> &#8211; This is a string that identifies the state, at the moment it&#8217;s ignored so you can enter anything you like here.</li>
<li><b>URL</b> &#8211; This is the URL that is set in the address bar and added to the browser history.</li>
</ul>
<div class="tip">
<h3>Note</h3>
<p>While the browser won&#8217;t request the new URL when calling pushState it will try to request it if the user reloads or restarts their browser it will try to request the URL, so you need to handle this on your server.</p>
</div>
<p>
There&#8217;s also a replaceState function, which does the same as the pushState except for one thing, instead of adding a new entry to the browser&#8217;s history, it replaces the current entry. It looks like this:
</p>
<pre class="brush: jscript; title: ; notranslate">
window.history.replaceState(object, &quot;Title&quot;, &quot;http://worldwidewhat.net/url&quot;);
</pre>
<p>
The pushState is a really interesting feature, It&#8217;s supported by Chrome, Firefox 4+, Safari 5+ and Opera 11.50+.
</p>
<p>
I&#8217;ll try to put together a complete tutorial on this in a while but as for now you can read more <a href="https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history">Mozilla&#8217;s developer pages</a>. Or check it out in action while <a href="https://github.com/Modernizr/Modernizr">browsing Modernizrs source on GitHub</a>.
</p>
<div class="tip">
<h3>Tip</h3>
<p>If you prefer the hashtag solution while pushState gets more widely accepted you can check out my tutorial on <a href="http://www.worldwidewhat.net/2011/06/making-seo-friendly-ajax-easy/">Making SEO Friendly Ajax Easy</a>.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.worldwidewhat.net/2011/11/change-browser-url-without-refreshing-page/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Collabora Shows off an HTML5 Video Editor</title>
		<link>http://www.worldwidewhat.net/2011/11/collabora-shows-off-an-html5-video-editor/</link>
		<comments>http://www.worldwidewhat.net/2011/11/collabora-shows-off-an-html5-video-editor/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 13:10:31 +0000</pubDate>
		<dc:creator>lasse</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Editor]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.worldwidewhat.net/?p=609</guid>
		<description><![CDATA[Witivi is an interesting project from Collabora, it&#8217;s a real time HTML5 video editor. It&#8217;s currently in a pretty early development stage but there&#8217;s plans on supporting transitions and other cool effects you&#8217;d expect from a video editor. For a demo and more information check out this blog post. http://mbatle.wordpress.com/2011/11/02/illusions-in-the-web-a-real-time-video-editor-built-in-html5/]]></description>
			<content:encoded><![CDATA[<p><span id="more-609"></span><!--noteaser--></p>
<p>
Witivi is an interesting project from Collabora, it&#8217;s a real time HTML5 video editor. It&#8217;s currently in a pretty early development stage but there&#8217;s plans on supporting transitions and other cool effects you&#8217;d expect from a video editor.
</p>
<p>
For a demo and more information check out this blog post.
</p>
<p>
<a href="http://mbatle.wordpress.com/2011/11/02/illusions-in-the-web-a-real-time-video-editor-built-in-html5/">http://mbatle.wordpress.com/2011/11/02/illusions-in-the-web-a-real-time-video-editor-built-in-html5/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldwidewhat.net/2011/11/collabora-shows-off-an-html5-video-editor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Has Released Dart, Tries to Replace JavaScript</title>
		<link>http://www.worldwidewhat.net/2011/10/google-has-released-dart-tries-to-replace-javascript/</link>
		<comments>http://www.worldwidewhat.net/2011/10/google-has-released-dart-tries-to-replace-javascript/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 08:08:44 +0000</pubDate>
		<dc:creator>lasse</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Dart]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.worldwidewhat.net/?p=594</guid>
		<description><![CDATA[According to Google, dart is suited for large scale web development and you can choose to run dart inside a virtual run time environment or by compiling it to regular JavaScript. The virtual environment is so far only supported in the latest version of Google Chrome. But if you convert it you should be able [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-594"></span><!--noteaser--></p>
<p>
According to Google, dart is suited for large scale web development and you can choose to run dart inside a virtual run time environment or by compiling it to regular JavaScript.
</p>
<p>
The virtual environment is so far only supported in the latest version of Google Chrome. But if you convert it you should be able to run it hassle free on Firefox 4+, Safari 5+ and Chrome. Google also promise that the compiled JavaScript will get better browser support soon.
</p>
<p>
You can read more about dart and even try it out your self on google&#8217;s own page <a href="http://www.dartlang.org/">http://www.dartlang.org/</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldwidewhat.net/2011/10/google-has-released-dart-tries-to-replace-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GTK 3.2 Lets You Run Applications Through Your Browser</title>
		<link>http://www.worldwidewhat.net/2011/09/gtk-3-2-lets-you-run-applications-through-your-browser/</link>
		<comments>http://www.worldwidewhat.net/2011/09/gtk-3-2-lets-you-run-applications-through-your-browser/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 18:14:13 +0000</pubDate>
		<dc:creator>lasse</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[GTK]]></category>
		<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://www.worldwidewhat.net/?p=555</guid>
		<description><![CDATA[That&#8217;s right, no remote desktop or anything is required, you can now access your GTK+ applications from a remote computer without needing anything else than a HTML5 enabled browser. For you who don&#8217;t know what either Gnome or GTK+ is, Gnome is one of the major desktop environments used on Linux and GTK+ is a [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-555"></span><!--noteaser--></p>
<p>
That&#8217;s right, no remote desktop or anything is required, you can now access your GTK+ applications from a remote computer without needing anything else than a HTML5 enabled browser.
</p>
<p>
For you who don&#8217;t know what either Gnome or GTK+ is, Gnome is one of the major desktop environments used on Linux and GTK+ is a toolkit which allows developers to create application user interfaces. Some famous GTK+ applications are GIMP, Pidgin and Inkscape.
</p>
<p>
Sounds impressing? Check this video for a demo:</p>
<p>
<a href="http://www.youtube.com/watch?v=AO-qca9ddqg">http://www.youtube.com/watch?v=AO-qca9ddqg</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldwidewhat.net/2011/09/gtk-3-2-lets-you-run-applications-through-your-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe&#8217;s Showing Off Some Really Cool HTML5/CSS3 Stuff</title>
		<link>http://www.worldwidewhat.net/2011/09/adobes-showing-off-some-really-cool-html5css3-stuff/</link>
		<comments>http://www.worldwidewhat.net/2011/09/adobes-showing-off-some-really-cool-html5css3-stuff/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 18:49:33 +0000</pubDate>
		<dc:creator>lasse</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://www.worldwidewhat.net/?p=548</guid>
		<description><![CDATA[Once upon a time not very long ago Flash was the standard when creating cool sites with things moving around and stuff like that&#8230; Or maybe it still is, but HTML5 is taking over more and more by the day, no one shows off with their new Flash based site anymore, it&#8217;s so last decade. [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-548"></span><!--noteaser--></p>
<p>
Once upon a time not very long ago Flash was the standard when creating cool sites with things moving around and stuff like that&#8230; Or maybe it still is, but HTML5 is taking over more and more by the day, no one shows off with their new Flash based site anymore, it&#8217;s so last decade.
</p>
<p>
At the same time HTML5 and CSS3 showcases have started to pop up like mushrooms. And Adobe has created one really impressive, called The Expressive Web, you can check it out here: <a href="http://beta.theexpressiveweb.com" target="_blank">http://beta.theexpressiveweb.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.worldwidewhat.net/2011/09/adobes-showing-off-some-really-cool-html5css3-stuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add JavaScript to The &lt;head&gt; Tag from your UserControls</title>
		<link>http://www.worldwidewhat.net/2011/09/add-content-to-the-tag-from-your-asp-net-usercontrol/</link>
		<comments>http://www.worldwidewhat.net/2011/09/add-content-to-the-tag-from-your-asp-net-usercontrol/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 10:44:48 +0000</pubDate>
		<dc:creator>lasse</dc:creator>
				<category><![CDATA[Downloads]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[UserControl]]></category>

		<guid isPermaLink="false">http://www.worldwidewhat.net/?p=532</guid>
		<description><![CDATA[I&#8217;ve developed quite a lot of UserControls in my days and I&#8217;ve always been annoyed by the ugly way to add JavaScript to the page header. So I took matter in my own hands and created yet another UserControl, this control will make it easier for you to add JavaScript from your current UserControls though. [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-532"></span><!--noteaser--></p>
<p>
I&#8217;ve developed quite a lot of UserControls in my days and I&#8217;ve always been annoyed by the ugly way to add JavaScript to the page header. So I took matter in my own hands and created yet another UserControl, this control will make it easier for you to add JavaScript from your current UserControls though.
</p>
<h2>The features if this control is:</h2>
<ul>
<li>Write syntax highlighted JavaScript directly in your .ascx file.</li>
<li>Allow only the same script once in the header even if you have multiple UserControls of the same type.</li>
<li>Easy to use, lightweight and no code behind required.</li>
</ul>
<h2>Example:</h2>
<p>First you need to register the UserControl as you do with a regular UserControl. You do this either in the UserControls you wish to use it in or in the web.config if you want to be able to use it everywhere.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;%@ Register Src=&quot;~/HeaderScripts.ascx&quot; TagPrefix=&quot;uc&quot; TagName=&quot;HeaderScripts&quot; %&gt;
</pre>
<p>
Next you add the script to you ascx, the SingleInstance property tells the control that only one HeaderScript are allow with the id specified in the ScriptID property. Remove the SingleInstance and ScriptID property if you don&#8217;t want the script to be unique.
</p>
<pre class="brush: xml; title: ; notranslate">
&lt;uc:HeaderScripts ID=&quot;script1&quot; SingleInstance=&quot;true&quot; ScriptID=&quot;s1&quot; runat=&quot;server&quot;&gt;
    &lt;script&gt;

        alert('Hello from Script 1');

    &lt;/script&gt;
&lt;/uc:HeaderScripts&gt;
</pre>
<p>That&#8217;s about it, quite simple to use huh?</p>
<div class="download">
<h3>Download</h3>
<p>You can download the UserControl and a complete example <a href="http://www.worldwidewhat.net/extras/javascript-from-your-asp-net-usercontrol/header-scripts.zip">here</a>.
</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.worldwidewhat.net/2011/09/add-content-to-the-tag-from-your-asp-net-usercontrol/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

