Hi,
I must begin to say that I'm rather new in wtiting and using JavaScript. Now
I want to use JavaScript in a HTML-page. On the homepage is a link. Every
time the homepage is displayed the link must point to another target. I want
to realize this by having a lot of differet targetpages. The names of these
pages are p1001.htm until p<nnnn>.htm. At this moment the last is p1153.htm,
but the amount is increasing every day.
I have a file named "counter.tx t" which contains one line with the string of
the last targetpage, at his moment "1153".
My idea is to have a JavaScript which:
1. reads the file counter.txt to determine the last available page
2. then takes at random one number between 1001 and 1153,
3. sets the HREF-link to page p<random>.htm.
I know it must be possible in JavaScript, but can anyone help me?
Thanks, 1 1173
asd987 wrote: Hi,
I must begin to say that I'm rather new in wtiting and using JavaScript. Now I want to use JavaScript in a HTML-page. On the homepage is a link. Every time the homepage is displayed the link must point to another target. I want to realize this by having a lot of differet targetpages. The names of these pages are p1001.htm until p<nnnn>.htm. At this moment the last is p1153.htm, but the amount is increasing every day. I have a file named "counter.tx t" which contains one line with the string of the last targetpage, at his moment "1153".
My idea is to have a JavaScript which: 1. reads the file counter.txt to determine the last available page 2. then takes at random one number between 1001 and 1153, 3. sets the HREF-link to page p<random>.htm.
I know it must be possible in JavaScript, but can anyone help me?
Thanks,
Did you not see my response in DW forum?
Mick This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Hansan |
last post by:
Hi all.
I am working on a webpage where I use python and html.
When I want to send one variable to a new script/page I use the following
code:
0) print '''<input type=hidden name="eventid"
value='''+str(variable_name)+'''>'''
This works fine, the problem occurs when I want to send a variable to a page
|
by: middletree |
last post by:
I have a menu that I use on my Intranet app, and while I did try to replace
it recently, I ended up going back to it. It's built entirely with
javascript, and works great.
However, there are certain pages where I would like to be able to put an
item into a querystring for a link. That is, I might have a link which is
worded "Add to this ticket" and the hyperlink associated with that text is
along the lines of...
|
by: olga |
last post by:
Hi,
On my site, i want to pass a javascript variable to php. I know
that this needs to done in a link or in a post. I want to know if
there is a way i can do it with an html link. I should mention
that these will be dynamically created links in php. This is
an optional value so if javascript is disabled, my site will still
function.
the browser_width() function works correctly but when i
|
by: Dr. Oz |
last post by:
Hi,
I am trying to read in a query string from one page and build a link to
another page based on the query string.
Here's the code I am using to read in the query string:
<script "text/javascript">
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
|
by: Clay_Culver |
last post by:
I have heard that it is possible to use classes + template magic to
make standalone functions (or maybe just a functor which acts like a
function) which can accept variable length arguments without using the
elipse. For example, a funciton could take in 1 known type, then a
variable list of other parameters:
ReturnValueClass rvc = someFunction("Some known type", 1, 0.2,
"string");
ReturnValueClass rvc2 = someFunction("Some known type...
| |
by: Melissa |
last post by:
I have a frontend file named CustomerApp and backend file named CustomerData.
CustomerApp is at C:\Customer Database and CustomerData is at S:\Customer
Database. Could someone help me with the code to do the following:
1. Create a new table named TblCustomerContact in CustomerData
2. Add a field named CustomerContactID (autonumber) in TblCustomerContact
3. Add a field named CustomerID (Number-Long) in TblCustomerContact
4. Add a field...
|
by: mikeoley |
last post by:
Ok I have a Javascript slideshow working. Every image is linked to a
another page in the site. Problem is...The link wont refresh to the
next link once the second images rollovers in the slideshow. It only
stays at the first images link.
Is this a cache issue? Or is there anyway to create a random number to
trick this or make it work properly. I'm very raw with Javascript so
I'm having trouble figuring this out.
Thank you in advance
|
by: Vyoma |
last post by:
This is quite a bit of problem I am facing, and I cannot point exactly
where I am going wrong. I have been lurking around at several forums
with regard to login and user authentication scripts and I have got as
far as this:
- Starting a session
- Registering a session variable
- Using the variable to check if the user is authenticated or not.
- Authenticating the user through MySQL database
- Logging of the user, by setting the...
|
by: John |
last post by:
Does the length of my C variable names have any affect, performance-wise, on
my final executable program? I mean, once compiled, etc., is there any
difference between these two:
number = 3;
n = 3;
I know its setting aside storage for the variable itself; does it also use
up more storage if the variable name is longer? I realize it would probably
take quite a lot of long variable names to make any impact if so, but I was
just curious...
|
by: sirjohnofthewest |
last post by:
If I possessed the power to sway the mind of every user in the world to delete all forms of Internet Explorer I would die a happy man.
Hi guys, I frequently visit this site to get answers to my problems and this one is really getting to me...
I have a page that allows you to Browse Authors. There are three drop down boxes that auto-populate via AJAX. I have a file which it calls and returns the dynamically built XML file in the boxes...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |