![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi Group, Here is a common problem: I have many (> 100) links on a web page, all pointing to different pages on the same domain (e.g., "http:// www.x12345.com/"). This is a bother because (1) it takes a lot of typing, and (2) more importantly, if (or when) the main URL changes, it takes a lot of work to update the links. |
|
Is there an easy way to specify somewhere in my html a "variable" (e.g. "$urlname"), and then assign it a value, so that later in the page I can refer to this variable instead of the full URL? |
#3
| |||
| |||
|
|
Here is a common problem: I have many (> 100) links on a web page, all pointing to different pages on the same domain |
|
Is there an easy way to specify somewhere in my html a "variable" (e.g. "$urlname"), and then assign it a value, so that later in the page I can refer to this variable instead of the full URL? |
#4
| |||
| |||
|
|
Hi Group, Here is a common problem: I have many (> 100) links on a web page, all pointing to different pages on the same domain (e.g., "http:// www.x12345.com/"). This is a bother because (1) it takes a lot of typing, and (2) more importantly, if (or when) the main URL changes, it takes a lot of work to update the links. Is there an easy way to specify somewhere in my html a "variable" (e.g. "$urlname"), and then assign it a value, so that later in the page I can refer to this variable instead of the full URL? Thanks in advance. |
#5
| |||
| |||
|
|
John U. wrote: Hi Group, Here is a common problem: I have many (> 100) links on a web page, all pointing to different pages on the same domain (e.g., "http:// www.x12345.com/"). This is a bother because (1) it takes a lot of typing, and (2) more importantly, if (or when) the main URL changes, it takes a lot of work to update the links. Is there an easy way to specify somewhere in my html a "variable" (e.g. "$urlname"), and then assign it a value, so that later in the page I can refer to this variable instead of the full URL? Thanks in advance. Not in HTML but in a server-side script the answer is yes. PHP: $bigArrayOfPagesObjects; $base='http://www.example.com/"; foreach($bigArrayOfPagesObjects as $object){ echo '<li><a href="' . $base . $object->href . '">" . $object->text . '</a></li>'; } how about doing it with JavaScript??? |
consult in
#6
| |||
| |||
|
|
maya wrote: how about doing it with JavaScript??? What about the ~10% of visitors who have it disabled, or stripped by a corporate firewall? |
#7
| ||||
| ||||
|
|
Beauregard T. Shagnasty wrote: maya wrote: how about doing it with JavaScript??? |
|
What about the ~10% of visitors who have it disabled, or stripped by a corporate firewall? |
|
people here and elsewhere are always saying this, but the fact is that most websites out there (except maybe strict amateurs) have some kind of JavaScript |
|
, I think if you disable JavaScript most websites wouldn't function properly. |
#8
| |||
| |||
|
|
Beauregard T. Shagnasty wrote: maya wrote: how about doing it with JavaScript??? What about the ~10% of visitors who have it disabled, or stripped by a corporate firewall? people here and elsewhere are always saying this, but the fact is that most websites out there (except maybe strict amateurs) have some kind of JavaScript, I think if you disable JavaScript most websites wouldn't function properly.. but oh well... it was just a suggestion... |
#9
| |||
| |||
|
|
the fact is that most websites out there (except maybe strict amateurs) have some kind of JavaScript, |
|
I think if you disable JavaScript most websites wouldn't function properly. |
#10
| |||
| |||
|
|
Here is a common problem: I have many (> 100) links on a web page, all pointing to different pages on the same domain (e.g., "http:// www.x12345.com/"). |
![]() |
| Thread Tools | |
| Display Modes | |
| |