Ajax Talk - Asynchronous javascript and xml discussion board
 FAQ   Search    Usergroups      Register   Profile   Check your messages   Log in 
Signup now to enjoy a range of free membership advantages !!
Ajax Talk - Moderators Wanted
MX ajax toolbox

 
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> AJAX Programmers Exchange
View previous topic :: View next topic  
Author Message
greenman
Fairly Frequent Poster
Fairly Frequent Poster


Joined: 19 May 2006
Posts: 12

PostPosted: Thu Jul 06, 2006 9:17 am    Post subject: MX ajax toolbox Reply with quote

http://www.interaktonline.com/demos/ajax/?from=gg_ajx1&gclid=CION6fDi_IUCFQwhMAodM3qNUg#Content__state=

this looks very cool, the funny thing is that when you go through the menu on the left, the page refreshes using Ajax (without complete refresh), and the url changes also.

never seen this before. very interesting.

Razz
_________________
just a frog
Back to top
View user's profile Send private message
mzaharia
New one
New one


Joined: 27 Jul 2006
Posts: 2

PostPosted: Thu Jul 27, 2006 4:24 pm    Post subject: MX AJAX Toolbox review Reply with quote

Hi,
The URL changes because the state of the page is remembered, in order to make the application bookmarkable by browsers and to fix any potential Back/Forward navigation issues.

There's also a more in-depth article describing the toolbox, here:
http://www.interaktonline.com/Support/Articles/Details/Sneak+preview+into+MX+AJAX+Toolbox.html?id_art=42

All the best!
Back to top
View user's profile Send private message
greenman
Fairly Frequent Poster
Fairly Frequent Poster


Joined: 19 May 2006
Posts: 12

PostPosted: Fri Jul 28, 2006 9:24 am    Post subject: hi Reply with quote

hi mzaharia,

i understand why they did it, just wondering how they did it.

rgds, greenman
_________________
just a frog
Back to top
View user's profile Send private message
Snyke
Forum Assistant
Forum Assistant


Joined: 20 Jun 2006
Posts: 87
Location: Zurich

PostPosted: Fri Jul 28, 2006 11:12 am    Post subject: Reply with quote

This is actually a pretty easy trick to do. Notice the '#' in the URL at a certain point, after which there is the information about the current page stored.
Usually the hash would have been used to mark a certain position in a document. You see, you can attribute a name to a position in a document by using the following code:
Code:
<a name="someName"/>

and the you would create a link that jumps to that position as soon as the page is loaded:
Code:
<a href="#someName">someName</a>

or
Code:
<a href="http://domain/path/page#someName">someName</a>

this clearly works only if the position has been marked before, if there is no such position the browser just ignores everything after the '#' meaning that you can store any data you want in the URL. Like in this case they store the current tab-name in the URL like this:
Code:
#Content__state=Documentation

You can store and retrieve information from the hash just like this:
Code:
// Store information
document.location.hash = "Some data I want to be in the bookmark";
// Retrieve information
var data = document.location.hash

Once you have the information in the script just do whatever you want to do, in this case load the correct tab off course ^^

Hope this explains what you need.
_________________
[::[ Snyke.net ]::]
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
greenman
Fairly Frequent Poster
Fairly Frequent Poster


Joined: 19 May 2006
Posts: 12

PostPosted: Fri Jul 28, 2006 2:37 pm    Post subject: Maintaining state Reply with quote

he Snyke,

that's kind of cool regarding the fact that everyone is complaining that ajax cannot maintain state.

does this prove them wrong ?

Bye greenman
_________________
just a frog
Back to top
View user's profile Send private message
Snyke
Forum Assistant
Forum Assistant


Joined: 20 Jun 2006
Posts: 87
Location: Zurich

PostPosted: Fri Jul 28, 2006 11:50 pm    Post subject: Reply with quote

Well sort of. Ajax are just like other applications, I use the word application intentionally here as we don't any longer speak of Web Services and Web Pages, that do have a start and an end (you start your Movie Player and it will close once it's donw playing the video right?). What the above does is bookmarking a state of the application, it's actually very arguable if this is desirable:
  • Following the old paradigm of URL (Uniform Resource Locator) we want to be able to Map a resource with a URL, this means that if I put an MP3 (the resource) online I can actually link to it through a URL.
  • Following the application paradigm it is clear that you get to a certain point in the application (say start, clck button a, confirm click, select a textbox) by performing actions inside the application, and it is not desirable to link to this state as it may break a lot of things or even wors it can get into an undefined state because we jumped certain steps...

So finally it's up to you, the designer, to decide wether or not the page you create are to be linkable or not. But rest assured, making a state of an application bookmarkable requires a lot of overhead, that you wont even consider in some cases.

Regards,
Christian 'Snyke' Decker[/list]
_________________
[::[ Snyke.net ]::]
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
mzaharia
New one
New one


Joined: 27 Jul 2006
Posts: 2

PostPosted: Mon Jul 31, 2006 12:40 pm    Post subject: Intranet or public sites Reply with quote

Hi,
Well, it all depends on the type of application you're building with AJAX. If it's a public website, than bookmarking and browser navigation are obviously important to your site visitors.
But if it's an Intranet that is used just by a couple of people, than it wouldn't really make sense to encode every state in the URL (although it can help, sometimes).

Just my two cents! Wink

Marius
Back to top
View user's profile Send private message
Snyke
Forum Assistant
Forum Assistant


Joined: 20 Jun 2006
Posts: 87
Location: Zurich

PostPosted: Mon Jul 31, 2006 2:21 pm    Post subject: Reply with quote

Well actually the decision wether to bookmark or not is a bit more difficult. Two examples are GMail (bookmarkable) and Meebo (not bookmarkable).You'll have to consider it carefully, before starting coding.
_________________
[::[ Snyke.net ]::]
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
deejay
Forum Assistant
Forum Assistant


Joined: 17 May 2006
Posts: 78
Location: Netherlands

PostPosted: Fri Aug 04, 2006 6:51 am    Post subject: Hi Reply with quote

Hi

I think it' the same decision as when deciding to implement a form using the 'POST' or 'GET' method.

When you want search results bookmarkable, u cannot use post as the browser cannot re-interpret the post variables (or superglobal array).

Ever noticed this annoying error message when you press "back" in the browser ? this is caused by 'POST' submitting the form.

So when you want your search results bookmarkable, you will use the 'GET' method.

I think u can use the same idea to decide on whether to use ajax with mainting state features.

Rgds, D.J.
_________________
please correct me if i am wrong
seo-expertglobalwarming
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> AJAX Programmers Exchange All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
 Advertisements
 XML & Copyright Notice 
    


Powered by phpBB © 2001, 2005 phpBB Group

What is according to Wikipedia: Ajax Web2.0 XML E4X


Link to our site:

  


del.icio.us digg spurl wists simpy newsvine blinklist furl blogmarks yahoo! myweb smarking ma.gnolia segnalo reddit fark technorati cosmos


Normal Bookmark


Partner Button Links:
Codecrunch.com: Webmaster Tutorials    One Ajax


Partner Text Links:
quomon | web20log | ajaxmatters | tableless | 456bereastreet | music charts | gift ideas | competitions | free xbox 360 | link trade ?


Credits:
it consultancy & project management lead generation zoekmachine optimalisatie steal these buttons seo expert