Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript: Reading from a file/generating GUID 1

Status
Not open for further replies.

fhlee

Technical User
Jan 23, 2002
133
TW
Hi,
Need some help. Basically, I need to generate a unique GUID {xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx} from client-side. Since I am not able to figure out how to do this on JAVASCRIPT Client-side, I figured that maybe I can (from client-side) open a file (say: and read the GUID off it (which is generated dynamically). Oh, to add to it, my script will be running from a different domain from the GUIDGenerator.asp. the GUIDGenerator.asp will only output just a line of GUID.

Can this be done? If yes, how. I'm trying to make it generic as in not MSIE specific (ie, I can run this on any browser). Any help/pointer will be appreciated. Thank you very much in advance.


~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
 
If you make yous ASP page output the GUID in a JS string:

Code:
var myGUID = '{xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx}';

then you can simply use the ASP page as a JS include file:

Code:
<script type="text/javascript" src="guidGenerator.asp"></script>

and then use the variable "myGUID".

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Genius!! Thanks sooo much!

~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top