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

Home Posts Topics Members FAQ

a href with static and dynamic content using JavaScript

Hello all

I'm quite new to web development, so please be kind ;)

I have a JS-function called getObjURL() which should return an URL-
String of an JS-object.

In the body part I use something like this:

<a href="../mystaticlink.htm?parameter=javascript:getObjURL()"
target="_blank"...>Linktext</a>

but this doesn't work.
I also tried:
<a href="../mystaticlink.htm?parameter="+javascript:getObjURL( )
target="_blank"...>Linktext</a>
<a href="../mystaticlink.htm?parameter=<%javascript:getObjURL( )%>"
target="_blank"...>Linktext</a>
.... and some other stupid things.

Could you please help me out of this?! Will it ever work or do I have
to use other web-technologies to create my dynamic link?

Best regards,
Schuessi
Oct 29 '08 #1
10 14150
On Oct 29, 3:31*pm, schuessi <schuessmas...@googlemail.comwrote:
Hello all

I'm quite new to web development, so please be kind ;)

I have a JS-function called getObjURL() which should return an URL-
String of an JS-object.

In the body part I use something like this:

<a href="../mystaticlink.htm?parameter=javascript:getObjURL()"
target="_blank"...>Linktext</a>

but this doesn't work.
I also tried:
<a href="../mystaticlink.htm?parameter="+javascript:getObjURL( )
target="_blank"...>Linktext</a>
<a href="../mystaticlink.htm?parameter=<%javascript:getObjURL( )%>"
target="_blank"...>Linktext</a>
... and some other stupid things.

Could you please help me out of this?! Will it ever work or do I have
to use other web-technologies to create my dynamic link?

Best regards,
Schuessi
Hello Schuessi.
try this..

<script language="JavaScript" type="text/javascript">
function getParam() {
return 'first';
}
function getLink() {
document.getElementById('link').href= 'mystaticlink.htm?
parameter=' + getParam();
}
</script>
<a href="#" onclick="getLink();" id="link">First</a>
Oct 29 '08 #2
On 29 Okt., 11:48, Suhas Dhoke <suhasdh...@gmail.comwrote:
On Oct 29, 3:31*pm, schuessi <schuessmas...@googlemail.comwrote:
Hello all
I'm quite new to web development, so please be kind ;)
I have a JS-function called getObjURL() which should return an URL-
String of an JS-object.
In the body part I use something like this:
<a href="../mystaticlink.htm?parameter=javascript:getObjURL()"
target="_blank"...>Linktext</a>
but this doesn't work.
I also tried:
<a href="../mystaticlink.htm?parameter="+javascript:getObjURL( )
target="_blank"...>Linktext</a>
<a href="../mystaticlink.htm?parameter=<%javascript:getObjURL( )%>"
target="_blank"...>Linktext</a>
... and some other stupid things.
Could you please help me out of this?! Will it ever work or do I have
to use other web-technologies to create my dynamic link?
Best regards,
Schuessi

Hello Schuessi.
try this..

<script language="JavaScript" type="text/javascript">
function getParam() {
* * return 'first';}

function getLink() {
* * document.getElementById('link').href= 'mystaticlink.htm?
parameter=' + getParam();}

</script>
<a href="#" onclick="getLink();" id="link">First</a>
This works great, thank you!
Oct 29 '08 #3
On Oct 29, 6:48*am, Suhas Dhoke <suhasdh...@gmail.comwrote:
On Oct 29, 3:31*pm, schuessi <schuessmas...@googlemail.comwrote:
Hello all
I'm quite new to web development, so please be kind ;)
I have a JS-function called getObjURL() which should return an URL-
String of an JS-object.
In the body part I use something like this:
<a href="../mystaticlink.htm?parameter=javascript:getObjURL()"
target="_blank"...>Linktext</a>
but this doesn't work.
I also tried:
<a href="../mystaticlink.htm?parameter="+javascript:getObjURL( )
target="_blank"...>Linktext</a>
<a href="../mystaticlink.htm?parameter=<%javascript:getObjURL( )%>"
target="_blank"...>Linktext</a>
... and some other stupid things.
Could you please help me out of this?! Will it ever work or do I have
to use other web-technologies to create my dynamic link?
Best regards,
Schuessi

Hello Schuessi.
try this..

<script language="JavaScript" type="text/javascript">
Don't use the language attribute.
function getParam() {
* * return 'first';}

function getLink() {
* * document.getElementById('link').href= 'mystaticlink.htm?
parameter=' + getParam();}

</script>
<a href="#" onclick="getLink();" id="link">First</a>
Ridiculous and inaccessible (whatever it is supposed to do.)
Oct 30 '08 #4
On Oct 29, 7:32*am, schuessi <schuessmas...@googlemail.comwrote:
On 29 Okt., 11:48, Suhas Dhoke <suhasdh...@gmail.comwrote:
On Oct 29, 3:31*pm, schuessi <schuessmas...@googlemail.comwrote:
Hello all
I'm quite new to web development, so please be kind ;)
I have a JS-function called getObjURL() which should return an URL-
String of an JS-object.
In the body part I use something like this:
<a href="../mystaticlink.htm?parameter=javascript:getObjURL()"
target="_blank"...>Linktext</a>
but this doesn't work.
I also tried:
<a href="../mystaticlink.htm?parameter="+javascript:getObjURL( )
target="_blank"...>Linktext</a>
<a href="../mystaticlink.htm?parameter=<%javascript:getObjURL( )%>"
target="_blank"...>Linktext</a>
... and some other stupid things.
Could you please help me out of this?! Will it ever work or do I have
to use other web-technologies to create my dynamic link?
Best regards,
Schuessi
Hello Schuessi.
try this..
<script language="JavaScript" type="text/javascript">
function getParam() {
* * return 'first';}
function getLink() {
* * document.getElementById('link').href= 'mystaticlink.htm?
parameter=' + getParam();}
</script>
<a href="#" onclick="getLink();" id="link">First</a>

This works great, thank you!
No it doesn't. You have been advised to do something stupid. Agents
without script or with script disabled will feature a link that does
nothing.

If you can explain just what it is you are trying to do, perhaps you
will get some competent advice.
Oct 30 '08 #5
On Oct 29, 6:31*am, schuessi <schuessmas...@googlemail.comwrote:
Hello all

I'm quite new to web development, so please be kind ;)
If you are new to Web development, then why are you trying to write
scripted enhancements. You should concentrate on creating proper
static documents first. Worry about scripting later.
>
I have a JS-function called getObjURL() which should return an URL-
String of an JS-object.
A what of a what? This is what I am talking about. You are jumping
in with both feet before you know what you are getting into.
>
In the body part I use something like this:

<a href="../mystaticlink.htm?parameter=javascript:getObjURL()"
target="_blank"...>Linktext</a>

but this doesn't work.
Which is hardly surprising. What made you think it would?
I also tried:
<a href="../mystaticlink.htm?parameter="+javascript:getObjURL( )
target="_blank"...>Linktext</a>
Programming by trial and error is not recommended.
<a href="../mystaticlink.htm?parameter=<%javascript:getObjURL( )%>"
You are officially lost.
target="_blank"...>Linktext</a>
... and some other stupid things.
Why are you wasting time with stupid things? Have you tried reading
about the subject?
>
Could you please help me out of this?! Will it ever work or do I have
to use other web-technologies to create my dynamic link?
I haven't the slightest idea what you are trying to do here.
Oct 30 '08 #6
On Oct 30, 5:55 am, David Mark <dmark.cins...@gmail.comwrote:
On Oct 29, 6:31 am, schuessi <schuessmas...@googlemail.comwrote:
Hello all
I'm quite new to web development, so please be kind ;)

If you are new to Web development, then why are you trying to write
scripted enhancements. You should concentrate on creating proper
static documents first. Worry about scripting later.
I have a JS-function called getObjURL() which should return an URL-
String of an JS-object.

A what of a what? This is what I am talking about. You are jumping
in with both feet before you know what you are getting into.
In the body part I use something like this:
<a href="../mystaticlink.htm?parameter=javascript:getObjURL()"
target="_blank"...>Linktext</a>
but this doesn't work.

Which is hardly surprising. What made you think it would?
I also tried:
<a href="../mystaticlink.htm?parameter="+javascript:getObjURL( )
target="_blank"...>Linktext</a>

Programming by trial and error is not recommended.
<a href="../mystaticlink.htm?parameter=<%javascript:getObjURL( )%>"

You are officially lost.
target="_blank"...>Linktext</a>
... and some other stupid things.

Why are you wasting time with stupid things? Have you tried reading
about the subject?
Could you please help me out of this?! Will it ever work or do I have
to use other web-technologies to create my dynamic link?

I haven't the slightest idea what you are trying to do here.
I wonder if we will get any reply on this one taking into
consideration that the OP just uttered the magic words; *it
works*. :-)

../sasuke
Oct 30 '08 #7
sasuke meinte:
>I haven't the slightest idea what you are trying to do here.

I wonder if we will get any reply on this one taking into
consideration that the OP just uttered the magic words; *it
works*. :-)
Another webpage atrocity meets the public. And I suppose the "solution"
gets copied thousands of times.

Gregor
Oct 30 '08 #8
On Oct 30, 10:37*am, Gregor Kofler <use...@gregorkofler.atwrote:
sasuke meinte:
I haven't the slightest idea what you are trying to do here.
I wonder if we will get any reply on this one taking into
consideration that the OP just uttered the magic words; *it
works*. :-)

Another webpage atrocity meets the public. And I suppose the "solution"
gets copied thousands of times.
Of course. I wonder what the blind community thinks of the Web. A
useless compendium of random gibberish? Google's excuse is they
"can't please everyone." It should be illegal (and is in some
countries, IIRC.) Perhaps that is the only way to take Website
development out of the hands of incompetents.
Oct 30 '08 #9
rf

"David Mark" <dm***********@gmail.comwrote in message
news:06**********************************@x41g2000 hsb.googlegroups.com...
On Oct 30, 10:37 am, Gregor Kofler <use...@gregorkofler.atwrote:
>Another webpage atrocity meets the public. And I suppose the "solution"
gets copied thousands of times.
>Of course. I wonder what the blind community thinks of the Web. A
useless compendium of random gibberish? Google's excuse is they
"can't please everyone." It should be illegal (and is in some
countries, IIRC.)
http://www.google.com.au/search?q=Maguire+vs+SOCOG

Oct 31 '08 #10
On Oct 30, 8:47*pm, "rf" <r...@invalid.comwrote:
"David Mark" <dmark.cins...@gmail.comwrote in message

news:06**********************************@x41g2000 hsb.googlegroups.com...
On Oct 30, 10:37 am, Gregor Kofler <use...@gregorkofler.atwrote:
Another webpage atrocity meets the public. And I suppose the "solution"
gets copied thousands of times.
Of course. *I wonder what the blind community thinks of the Web. *A
useless compendium of random gibberish? *Google's excuse is they
"can't please everyone." *It should be illegal (and is in some
countries, IIRC.)

http://www.google.com.au/search?q=Maguire+vs+SOCOG
Good link. I can't understand why, with all of the special interest
groups out there, nobody has taken Google to court on their numerous
accessibility barriers. Maybe then their "engineers" (quotes indicate
I once talked to one about this subject and he was no engineer) will
get the point.
Oct 31 '08 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1766
by: namemattersnot | last post by:
Re, SCENARIO: User clicks a link and a javascript function creates dynamic content in <div id="content"></div> using: document.getElementById("content").innerHTML = something In the page's...
2
2895
by: jitu78 | last post by:
Hi All, I am having problem with Pixel fonts in Flash. When I am using pixel fonts for dynamic contents, textual data is looking blurry. They are showing right with static content. That’s...
7
1865
by: satishr23 | last post by:
Hi, I am using AJAX to display dynamic RSS feeds in my web page. So on page load i am callin the AJAX function Start_Timer() The body of Start_Timer() is as follows. function Start_Timer() { ...
9
2919
by: pbd22 | last post by:
Hi. This is just a disaster management question. I am using XMLHTTP for the dynamic loading of content in a very crucial area of my web site. Same as an IFrame, but using XMLHTTP and a DIV. I...
4
2081
by: ravisuguna | last post by:
Hi, I have a dynamic table in my programme in php and the value of a particular cell gets reduced after every 3 seconds.I want to change the bg color of that particular into a different color when...
0
806
by: FrankieBakerJr | last post by:
I'm looking for a way to ensure the display of official dynamic documents on my company’s website, including fonts, images, letter-head, etc. Since users have the ability to change the way their...
3
4838
by: tokcy | last post by:
hi everyone, i am creating dynamic row in a table using javascript its working fine and now i want to create more than 1 table using javascript which is dynamic its also working fine but when i am...
1
1448
by: sahilansari | last post by:
My Code Works Fine.....What i want to do is to read some where this new menu(.....) & stuff within it works.Like some book or some article on the web. Or better still any one of you can explain...
1
3874
by: visweswaran2830 | last post by:
Hi, I want to insert href into tabel cell using javascript. Note should support all browser. I know to insert, but it support only in IE, I checked in firefox, it does not support so please...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7280
Oralloy
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,...
0
7332
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...
0
5578
agi2029
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,...
0
4673
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
3167
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...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
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 ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.