Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > AJAX question..

Reply
Thread Tools

AJAX question..

 
 
Frances
Guest
Posts: n/a
 
      05-31-2006
am just starting out with AJAX, got example from here,
http://www.w3schools.com/ajax/ajax_example.asp working fine

but I have a question (actually I have many questions, but will start
with this one for now..)

in this line of code

var url="gethint.asp?sid="+Math.random()+"&q="+str

what is purpose of 'sid' param in query string, this is not used at all
in code, I even changed this line to..

var url="gethint.asp?q=" + str

and it worked just as well.. thank you...



 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      05-31-2006


Frances wrote:


> in this line of code
>
> var url="gethint.asp?sid="+Math.random()+"&q="+str
>
> what is purpose of 'sid' param in query string, this is not used at all
> in code,


It might be an attempt to prevent the browser from returning a cached
resource.

--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
 
petermichaux@gmail.com
Guest
Posts: n/a
 
      05-31-2006
Frances wrote:
> am just starting out with AJAX


I really like the w3schools tutorials. Once you finish those I suggest
you look at the Yahoo! UI connection library for something you might
use in your real projects.

http://developer.yahoo.com/yui/connection/

Peter

 
Reply With Quote
 
the DtTvB
Guest
Posts: n/a
 
      06-01-2006
Andy Baxter wrote:
> sid usually means 'session identification' i.e. it's the server's way of
> remembering that you are the same user across a series of otherwise
> unrelated page requests. Http is a stateless protocol which doesn't
> remember who you are between one request and the next, so people have to
> invent tricks like this to get round that.


Yes, it is, but not in this one..
That number is "not" session id, but it's a random number just to
prevent cache.
Like if I do the first request on 7:50:21 and I do the same URL request
again on 7:50:30, the browser may get the cached (saved) or outdated
data on 7:50:21. I have to put some random number on my URL request.
Sometimes I even used Math.random() + '' + new Date().getTime()

My question is why did they used the word 'sid' while it's not sid?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
An Ajax Dictionary... My first AJAX project... GreatDomainz@gmail.com HTML 20 03-31-2008 01:24 PM
Deploying ASP.NET AJAX-Enabled Web site to host without AJAX insta =?Utf-8?B?QnJpYW4gRWR3YXJkcw==?= ASP .Net 2 02-21-2007 10:22 PM
AJAX IDE and AJAX TOOL--The Release of JoyiStar AJAX WebShop 3 Beta minnie Java 1 12-13-2006 06:29 AM
Ajax installed.. where are Ajax controls like popup in my VS toolbox ?? jobs ASP .Net 0 11-06-2006 01:23 AM
beginner AJAX questions (AJAX.net) darrel ASP .Net 5 04-28-2006 06:42 PM



Advertisments