Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Two JavaScript Questions  (Read 1007 times)

0 Members and 1 Guest are viewing this topic.
Two JavaScript Questions
« on: August 14, 2006, 05:23:48 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 221
How do you access the variables that are in the url of something? Like if I made a page called "bobdole.com/cheese.html" and then typed in "bobdole.com/cheese.html?q=swedish%20meatballs", what would I have to type in the page to access that q variable?

Also, how do I prompt a download? Like the little popup boxes that say Open/Save/Cancel or whatever.
Logged

mit

Re: Two JavaScript Questions
« Reply #1 on: August 18, 2006, 11:13:49 am »
  • QBASIC programmer since age 4. Take that, world.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 1079
Promting a download is usually done via a timed refresh, such as
Code: [Select]
<meta http-equiv="refresh" content="5;url=http://your.file.to.download.zip">
The 5 is the number of seconds.  Or, via javascript, you could set window.location (or one of its many aliases) to the URL of the file, or if you wanted to time that;
Code: [Select]
<script>setTimeout('window.location="http://your.file.to.download.zip"',5000);</script>
The 5000 is in miliseconds.

As for getting the URL variables, I've no idea, I always fetch them through PHP.
Logged
Programmer / Spriter / Level designer / Game Director / Web Designer / Music Sequencer for
Random Highscore table:

Play the Kousou Arcade today!
  • Kousou Games
Re: Two JavaScript Questions
« Reply #2 on: August 18, 2006, 12:32:17 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 2245
Logged
Re: Two JavaScript Questions
« Reply #3 on: August 18, 2006, 05:49:35 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 221
Thanks guys.
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.041 seconds with 42 queries.

anything