473,387 Members | 1,463 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

AJAX question..

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...

May 31 '06 #1
4 1569


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/
May 31 '06 #2
Frances said:
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...


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.

--
http://www.niftybits.ukfsn.org/

remove 'n-u-l-l' to email me. html mail or attachments will go in the spam
bin unless notified with [html] or [attachment] in the subject line.

May 31 '06 #3
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

May 31 '06 #4
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?

Jun 1 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: G Matthew J | last post by:
interesting "signal vs. noise" blog entry: http://37signals.com/svn/archives2/whats_wrong_with_ajax.php
21
by: javainfo | last post by:
How can i refresh IFRAME and load data through AJAX?
9
by: darrel | last post by:
Last week I asked about ASP.net 2.0 AJAX frameworks and there appears to be several to choose from. I haven't used ASP.net 2.0 yet, but from doing a bit of reading, it appears that ASP.net 2.0...
31
by: Tony | last post by:
I just noticed that prototype.js is one of the files in the Ajax.NET distribution - I'm pretty concerned about this. Does anyone know if this is the same "prototype.js" that is not well-liked...
1
by: codefragment | last post by:
Hi I have asked this on the official asp.net forums but no luck so thought I'd try here Assume you have a page with a filter control and a grid view and many other controls on it. When the...
8
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I'm about to finally make the jump and start a new site using AJAX. THe question i have for all of you AJAX developers out there is which one? 1. The Standard AJAX frame work 2. The Tool kit....
2
by: =?Utf-8?B?VG9u?= | last post by:
Hello, I want to understand teh benefits of ajax technology. Does anyone has a good website where AJAX EXTENSIONS is worked out so I really understand it. There a 2 main questions: 1) How about...
2
by: Cirene | last post by:
3 quick questions... 1. Are the controls in the AJAX Futures download "beta" or the release and stable version? 2. Also, where is the best way to learn how to implement these? (Other than by...
6
by: Jonathan Wood | last post by:
Greetings, I'd like to implement some AJAX features on an existing ASP.NET site. I have one example of doing this but, otherwise, don't know much about it. I have one question, though, about...
22
by: sheldonlg | last post by:
I am looking for a clean solution to a problem that I solved in, what I call, a "dirty" way. Here is what I want to do. I have a dropdown list. Clicking on an item in the dropdown list invokes...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.