473,503 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to set drop-down-menu of html file to desired parameter given by URL?

31 New Member
I am creating a html file with a table over xslt. I am using JavaScript for filtering some rows. Is it possible to write some parameters behind the URL to change the drop-down-menu item when I open the html-file the first time?
For example I got the html file "my_file.html".
Is it possible to change this to e.g. "my_file.html -parameter", then read "parameter" with javascript and set my drop-down-menu to Paramter?
I do not want to make a new entry "Parameter" to my drop-down-menu. I just would like to show the parameter item in my drop-down-menu and my table should be filtered by that.
Jun 17 '19 #1
8 1197
gits
5,390 Recognized Expert Moderator Expert
what you like to do here is a typical GET request with a querystring - basically it could look similar to this:

Expand|Select|Wrap|Line Numbers
  1. http://myurl.com?myParam=value
of course you can use JavaScript for that by using the location-object - but since it is a GET request that first goes through to the server you could even set a selected attribute at the serverside already - since there you would have the parameter as well already.
Jun 17 '19 #2
Daniel1111
31 New Member
I am sorry I do not like to read the URL but like to read my file name: I have just explained it wrong. See the following:

I got a html-file in some folder. The file is called "file.html". I create a link-file to "file.html" on my desktop or anywhere else. The link file's name is "file.html" as well. Now I rename my link file to "file.html -Parameter".

For my "file.html" I am using some JavaScript to filter some rows of a table which is being created.

My question is: Is it possible to read "Parameter" of my link file in my JavaScript and how can I do this?
Jun 18 '19 #3
gits
5,390 Recognized Expert Moderator Expert
well - i dont think that this is possible - the html file is opened in a browser thus your only way to pass something on to that page is through a URL. what your page could do though is - onLoad it could request something.

On the other hand i am wondering whether the parameter is constant as it looks now? In that case you could even hardcode it in a variable in the page's javascript.
Jun 18 '19 #4
Daniel1111
31 New Member
The thing is I may have e.g. 10 link files to my originial file "file.html". Each link file does have an extra constant Parameter. If I open one link file with the Parameter e.g. "Monday" than I want to show "Monday" in my drop-down-menu. This is a selecting by opening a file. A new entry "Monday" to my drop-down-menu shoud not be added.

So I need a already selected drop-down-menu which depends on the opening of a link-file, not the original file.
Do you understand? If you understand: Do you have any other ideas how I can change my drop-down-menu by opening a link-file? Should be working with JavaScript as I already have a working JavaScript file.

PS: I can also name my link-file just Monday, because it is just a link-file.
Jun 18 '19 #5
gits
5,390 Recognized Expert Moderator Expert
i understand - but as i said - you cannot pass something like that to a website (the page wont know anything about your link file or how it was started in the browser) - but what you can do is creating a shortcut to IE for example with the URL and the correct parameters (with quotes where needed).

if its the case of date/day related selections then you can implement that in JavaScript itself as well so it would always select the correct value.
Jun 18 '19 #6
Daniel1111
31 New Member
I did create a shortcut. But I don't get it how this should work with parameters as it is the same like the link-file. How should it be possible read the parameters with JavaScript then. They are not in the URL as the URL is the original file.. hm
Jun 18 '19 #7
gits
5,390 Recognized Expert Moderator Expert
basically the shortcut would look like this:

Expand|Select|Wrap|Line Numbers
  1. "path to IE exe" "file://path-to-file.html?param=foo"
then in javascript you can simply use the location object to work with the querystring.
Jun 18 '19 #8
Daniel1111
31 New Member
Oh wow. Yes that's nice. Thanks :)
Jun 18 '19 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

12
2655
by: Xah Lee | last post by:
would anyone like to translate the following perl script to Python or Scheme (scsh)? the file takes a inpath, and report all html files in it above certain size. (counting inline images) also...
6
3265
by: Vijay | last post by:
I need to generate HTML files based on the some codes. One HTML file per code. I have the link (ex:http://123.234.345.456/WebPages/GetTestData.aspx?SomeCode=25), by passing the code as parameter I...
2
2408
by: Tor Inge Rislaa | last post by:
Showing an HTML file in part of a Webform Hi I have a Webform with some buttons on the left side of the form. What I want when clicking one of the buttons is to show an HTML document in a part...
1
2355
by: Stephane | last post by:
Hi, I have a html file file that I want to parse with ASP.NET to retreive the value of a custom tag. Let's say that the average html file is about 30 ko. Once the html file is loaded and...
7
1889
by: Steve Bugden | last post by:
Hi, I am trying to reference an html page from an aspx file. The intention is that the html file will contain the content for my web site and the aspx will contain the navigation, logo etc. Then...
7
2233
by: Brian | last post by:
I wrote this script here but I cannot get the script to save to the correct month.html. Can someone tell me what is wrong with this code? <html> <head> <title>Monthly Bills</title> </head>...
1
24145
by: amit | last post by:
Hello Group, Does anybody know how I can have a global variable in an HTML file? for instance, I have a fuction (called aFunction() here) and during a mousedown or up event the function is going...
5
1756
by: priscilla | last post by:
Hi, I am a beginer in perl programming , my task is to extract content with in form tags from a HTML file.I tried doing it using Regular expression but could not get the desired result as the HTML...
10
7748
by: lg | last post by:
My site consists of many htm pages and each has a banner with my address and some graphic. Now each html page is something like this: <html> blah blah <div> my logo my address </div>
3
6036
by: Mark | last post by:
Hello This might be an odd question. I have an Excel VBA program that searches through a folder for any .htm or .html file, searches the file for any 'hrefs' and prints them to the spreadsheet....
0
7074
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
7322
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...
1
6982
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7451
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5000
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4667
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3161
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
374
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.