473,569 Members | 2,704 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.ht m?parameter=jav ascript:getObjU RL()"
target="_blank" ...>Linktext</a>

but this doesn't work.
I also tried:
<a href="../mystaticlink.ht m?parameter="+j avascript:getOb jURL()
target="_blank" ...>Linktext</a>
<a href="../mystaticlink.ht m?parameter=<%j avascript:getOb jURL()%>"
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 14167
On Oct 29, 3:31*pm, schuessi <schuessmas...@ googlemail.comw rote:
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.ht m?parameter=jav ascript:getObjU RL()"
target="_blank" ...>Linktext</a>

but this doesn't work.
I also tried:
<a href="../mystaticlink.ht m?parameter="+j avascript:getOb jURL()
target="_blank" ...>Linktext</a>
<a href="../mystaticlink.ht m?parameter=<%j avascript:getOb jURL()%>"
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="JavaS cript" type="text/javascript">
function getParam() {
return 'first';
}
function getLink() {
document.getEle mentById('link' ).href= 'mystaticlink.h tm?
parameter=' + getParam();
}
</script>
<a href="#" onclick="getLin k();" id="link">First </a>
Oct 29 '08 #2
On 29 Okt., 11:48, Suhas Dhoke <suhasdh...@gma il.comwrote:
On Oct 29, 3:31*pm, schuessi <schuessmas...@ googlemail.comw rote:
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.ht m?parameter=jav ascript:getObjU RL()"
target="_blank" ...>Linktext</a>
but this doesn't work.
I also tried:
<a href="../mystaticlink.ht m?parameter="+j avascript:getOb jURL()
target="_blank" ...>Linktext</a>
<a href="../mystaticlink.ht m?parameter=<%j avascript:getOb jURL()%>"
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="JavaS cript" type="text/javascript">
function getParam() {
* * return 'first';}

function getLink() {
* * document.getEle mentById('link' ).href= 'mystaticlink.h tm?
parameter=' + getParam();}

</script>
<a href="#" onclick="getLin k();" id="link">First </a>
This works great, thank you!
Oct 29 '08 #3
On Oct 29, 6:48*am, Suhas Dhoke <suhasdh...@gma il.comwrote:
On Oct 29, 3:31*pm, schuessi <schuessmas...@ googlemail.comw rote:
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.ht m?parameter=jav ascript:getObjU RL()"
target="_blank" ...>Linktext</a>
but this doesn't work.
I also tried:
<a href="../mystaticlink.ht m?parameter="+j avascript:getOb jURL()
target="_blank" ...>Linktext</a>
<a href="../mystaticlink.ht m?parameter=<%j avascript:getOb jURL()%>"
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="JavaS cript" type="text/javascript">
Don't use the language attribute.
function getParam() {
* * return 'first';}

function getLink() {
* * document.getEle mentById('link' ).href= 'mystaticlink.h tm?
parameter=' + getParam();}

</script>
<a href="#" onclick="getLin k();" 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.comw rote:
On 29 Okt., 11:48, Suhas Dhoke <suhasdh...@gma il.comwrote:
On Oct 29, 3:31*pm, schuessi <schuessmas...@ googlemail.comw rote:
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.ht m?parameter=jav ascript:getObjU RL()"
target="_blank" ...>Linktext</a>
but this doesn't work.
I also tried:
<a href="../mystaticlink.ht m?parameter="+j avascript:getOb jURL()
target="_blank" ...>Linktext</a>
<a href="../mystaticlink.ht m?parameter=<%j avascript:getOb jURL()%>"
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="JavaS cript" type="text/javascript">
function getParam() {
* * return 'first';}
function getLink() {
* * document.getEle mentById('link' ).href= 'mystaticlink.h tm?
parameter=' + getParam();}
</script>
<a href="#" onclick="getLin k();" 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.comw rote:
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.ht m?parameter=jav ascript:getObjU RL()"
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.ht m?parameter="+j avascript:getOb jURL()
target="_blank" ...>Linktext</a>
Programming by trial and error is not recommended.
<a href="../mystaticlink.ht m?parameter=<%j avascript:getOb jURL()%>"
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.comw rote:
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.ht m?parameter=jav ascript:getObjU RL()"
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.ht m?parameter="+j avascript:getOb jURL()
target="_blank" ...>Linktext</a>

Programming by trial and error is not recommended.
<a href="../mystaticlink.ht m?parameter=<%j avascript:getOb jURL()%>"

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...@gregork ofler.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******** *************** ***********@x41 g2000hsb.google groups.com...
On Oct 30, 10:37 am, Gregor Kofler <use...@gregork ofler.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

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

Similar topics

4
1771
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 header I load a javascript that does nice effect to pictures. In HTML code I have the following element that contains referect for that said...
2
2897
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 why I am using "Arial" for dynamic data. Here is my dynamic content,
7
1875
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() { getRSS(); //This is the function which gets the RSS feeds and displays it in a div tag in the page. t=setTimeout("Start_Timer()",6000); }
9
2933
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 got the core of the javascript from here: http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm I noticed in the demo that sometimes the...
4
2094
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 it reaches '0'.Pl help me. thanks in advance Suguna
0
813
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 browsers display, HTML isn't reliable. I'd like to manually create a PDF to look like a standard letter-head from our company. This PDF would have...
3
4844
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 taking the value of each table individually thats i am not able to get any value. if i get the value of table then its not taking properly. let...
1
1451
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 this to me..the part highlighted in bold. Part1 menus = new menu(22, "horizontal", 2, 101, -1, 1, "#34B0B0", "#A8E5E6", "Verdana,Helvetica", 9, ...
1
3883
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 help me. This is code to insert(works in IE) var myLink = document.createElement('a'); var href = document.createAttribute('href');
0
7698
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
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, 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. ...
1
7673
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...
0
7970
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 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...
0
6284
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.