View html source for AJAX content with Firefox

by Keith Dsouza | Translate | Print
Tuesday, 19th Jun 2007 | Share


Share View html source for AJAX content with Firefox on Twitter Share View html source for AJAX content with Firefox on Facebook Save View html source for AJAX content with Firefox To Delicious Favorites Stumble View html source for AJAX content with Firefox Share View html source for AJAX content with Firefox on Digg Get Instant Updates as RSS Feeds from Techie Buzz

Many sites use AJAX (Asynchronous Javascript and XML) to display the content to users. It has become difficult for both developers and designers to view the html source using the regular view source method when sites display content using AJAX. The reason is because the content is not actually on the page and is being dynamically added to the page.

For example in Firefox you can go to View menu and click on View Source to view the source or use the shortcut combination Ctrl + U. But doing that on a rich site powered by Ajax will not show you the AJAX response in the source. A simple example would be Gmail just use the regular method to view the source and you would actually see some javascript code.

But there is a simple way in which you can overcome this problem using a simple solution in Firefox. All you have to do is select the text and right click anywhere on the page. Once you have done that you will see a hidden option View Selection Source. Once you click on this option you will see the actual HTML content that is used for displaying the selected content.

view-selection-source

Now you can use this method and view the html source for any website even though if uses AJAX. I find this very useful when I create AJAX based sites and want to see if the html layout is proper.

Bonus Tips

If you are viewing a site but still cannot see the actual source just right near the content. If you see a additional context menu called This Frame it means that the content you are viewing is in a frame. Just go to the This Frame context menu and select any of the options that is provided.

frame-source-tip

If you are a developer then you should definitely have the Firebug extension installed it is a awesome tool that helps in developing and deploying web sites you can also debug AJAX requests and responses using Firebug. Firebug allows you to edit, debug, and monitor CSS, HTML and Javascript live for any web page.

Download Firebug for Firefox



Share

One Response so far | Share Your Opinions!

  1. Nikola Toljic
    June 26th, 2009 at 12:39 pm #

    thanks for the tip

    Reply to this comment

Leave a Comment

Note: We discourage users from using keywords in their names while posting comments, most of them get caught by spam, also it really would be more fruitful in knowing people who comment by their real name, rather than by using a name no one relates to. In future we reserve the right to delete comments from users using a name other than their own.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>