Sponsored Content
Full Discussion: Dynamic Hyperlink
Top Forums Web Development Dynamic Hyperlink Post 302586734 by Skrynesaver on Tuesday 3rd of January 2012 05:52:20 AM
Old 01-03-2012
You have to explicitly set the link rather than expecting it to be evaluated on the fly. There are JS libraries that implement sprintf also consider the ternary operator in this context eg month>10 ? month +1 : '0' + (month +1) for more legible filenames
Code:
<html>
  <head>
    <script type="text/javascript" language="JavaScript">
      function setLink(variableLink)
      {
        var now = new Date();
        var month    = now.getMonth();
        var day = now.getDate();
        var year = now.getYear();
        if(year < 2000) { year = year + 1900; }
        //var dateString = sprintf("http://test.com/%2d-%2d-%4d.html" ,
        //                         month, day,year);
        var dateString ='http://test.com/'
                                  + month + '-'
                                  + day   + '_'
                                  + year  + '.html';
        var anchor=document.getElementById(variableLink);
        anchor.href=dateString;
      }
    </script>
  </head>
    
  <body "onLoad=setLink('variableLink');">
     <a Id="variableLink" href="">Today</a>
  </body>
</html>

This User Gave Thanks to Skrynesaver For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Moving .html files while preserving hyperlink integrity?

Hi, I use a Windows-based program called <a href="http://www.coast.com">Coast Webmaster</a> for moving large numbers of HTML files in one directory to another directory. As you drag and drop each file or entire directory of files to new locations in the web root directory tree, this utility... (1 Reply)
Discussion started by: Buddy123
1 Replies

2. Shell Programming and Scripting

How to add Hyperlink with shell script(using mail client)

Hi ! plz let me suggest ..... By using of mail client methods I am trying to send mails through shell script. like.... To: From: Sub: Body: some sample text..... <my requirement is how to add hyper link to some text(click me) ... (0 Replies)
Discussion started by: rsukumar
0 Replies

3. Shell Programming and Scripting

Awk scripting and usage of regex to locate a hyperlink

Hello guys, I need to write awk script that would take an html page and output a list of each unique http link on that webpage followed by the number of times it occurred in that file. e.g. ----------------------------------------- Webpage: index.html http://www.google.com/ 3... (1 Reply)
Discussion started by: grinch
1 Replies

4. UNIX for Dummies Questions & Answers

Create Hyperlink

Hi Everybody, I am new to this forum. I need help. Here is the details: I have a .csv file in unix server which is 2MB size I am attaching this file and sending to all users who are in my team thru Microsoft outlook. All users requested me to send the link where we can click and open... (1 Reply)
Discussion started by: utham1
1 Replies

5. Shell Programming and Scripting

Using Perl to add hyperlink to html files

Hi , I have written a csh script which will output file named " myoutput.html " displayed below. I am tried to ftp this html file into a local web server so that it can be displayed to public sharing this server and i would want to add a hyperlink to " XX " , " YY " , " ZZ ". Can this be done... (17 Replies)
Discussion started by: Raynon
17 Replies

6. AIX

hyperlink settings

Does anyone know the hyperlink settings to look at an AIX5L box? (1 Reply)
Discussion started by: vbagwell
1 Replies

7. AIX

HELP!windows hyperlink to 9600 baud 8N1

We are trying to use the Windows hyperlink as a console to our AIX box. We are using 9600 baud 8N1. (1 Reply)
Discussion started by: vbagwell
1 Replies

8. AIX

Connect to AIX via Windows hyperlink

We do not have a console for our box so we are trying to hyperlink in - does anyone know the settings? (9 Replies)
Discussion started by: vbagwell
9 Replies

9. UNIX for Advanced & Expert Users

Sql dynamic table / dynamic inserts

I have a file that reads File (X.txt) Contents of record 1: rdrDESTINATION_ADDRESS (String) "91 971502573813" rdrDESTINATION_IMSI (String) "000000000000000" rdrORIGINATING_ADDRESS (String) "d0 movies" rdrORIGINATING_IMSI (String) "000000000000000" rdrTRAFFIC_EVENT_TIME... (0 Replies)
Discussion started by: magedfawzy
0 Replies
HTML::FormHandler::Result(3pm)				User Contributed Perl Documentation			    HTML::FormHandler::Result(3pm)

NAME
HTML::FormHandler::Result - form result object VERSION
version 0.40013 SYNOPSIS
This is the Result object that maps to the Form. my $result = $self->form->run( $params ); my $result2 = $self->form->run( $other_params ); my $value = $result->field('title')->value; my $fif = $result->fif; my $field_fid = $result->field('title')->fif; DESCRIPTION Although not experimental, the 'results' have not been exercised as much as the other parts of the code. If there is missing functionality or things that don't work, please ask or report bugs. The original FormHandler 'process' method, when used with persistent forms, leaves behind state data for a particular execution of 'process'. This is not optimal or clean from an architectural point of view. The intention with the 'result' object is to separate dynamic data from static. The 'form' object is treated as a kind of result factory, which will spit out results and leave the form in a consistent state. In the current state of implementation, the result object can be used to render a form: $result->render; However there are still open questions about how much of the form/field should be forwarded to the result. At this point, the number of forwarded methods is minimal. Mechanisms to make this more customizable are being considered. Dynamic select lists are not supported yet. Static select lists (that are the same for every form execution) should work fine, but lists that are different depending on some field value will not. Most of this object is implemented in HTML::FormHandler::Role::Result, because it is shared with HTML::FormHandler::Field::Result. AUTHOR
FormHandler Contributors - see HTML::FormHandler COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Gerda Shank. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-25 HTML::FormHandler::Result(3pm)
All times are GMT -4. The time now is 12:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy