Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: html JavaScript variable question  (Read 830 times)

0 Members and 1 Guest are viewing this topic.

Dartful Dodger

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3453
  • Last login:July 23, 2012, 11:21:39 pm
  • Newer isn't always better.
html JavaScript variable question
« on: January 26, 2007, 05:12:06 pm »
This should be simple, but it's Friday and I'm tired so I'm not thinking straight.  I should post this to a JavaScripting site, but you guys usually reply faster.

I have an application that opens up a webpage.

The application is on the hard drive and the webpage is on a cd.

I need to be able to pass a variable from the application to the webpage, to add to the nonsense this needs to be cross platform.

I've tried to open up the webpage using this type of link:

myPage.htm?myVariable=test

The application can open up "myPage.htm", but when I add the "?Myvariable=test", it gives me a page can not be found.

I'm not concerned if the user can see the variable.

I also need to know what code goes on the html page to read the variable.

Thanks for any help

AlanS17

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5382
  • Last login:December 02, 2019, 08:35:48 am
  • I won't even pretend to be clever...
    • AlanS17
Re: html JavaScript variable question
« Reply #1 on: January 27, 2007, 03:05:04 am »
Are you opening it as a http or as a file? Only http request from a dedicated server will read javascript correctly (I think). It's two AM and I'm drunk so I'm not 100% sure on that.


patrickl

  • I cannot know for certain which will be tastiest
  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4614
  • Last login:August 27, 2021, 09:25:30 am
  • Yo momma llama
    • PocketGalaga
Re: html JavaScript variable question
« Reply #2 on: January 27, 2007, 04:40:51 am »
Javascript will run fine with html files from a CD. Passing variables will not work when you don't have a web server. A webserver will translate the ?Myvariable=test part to a variable. If the file resides on a CD there is no translation and the file is looked for literally
This signature is intentionally left blank

Dartful Dodger

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3453
  • Last login:July 23, 2012, 11:21:39 pm
  • Newer isn't always better.
Re: html JavaScript variable question
« Reply #3 on: January 29, 2007, 01:05:07 pm »
Thanks, I figured it was something like that but I wanted to make sure before I wrote it off as an option.

I'm going to start working on plan B.

The website is in frames so I'll write an installer program that creates the start html with the frames and the navigational html page on the user's harddrive.  These pages will have the directories hard coded in the html.

This might end up being the easier and more efficient way to handle this.

Thanks again.