You are here: Re: Javascript: is it possible to pass a parameter to a function inside a document write? « HTML « IT news, forums, messages
Re: Javascript: is it possible to pass a parameter to a function inside a document write?

Posted by rf on 10/07/05 11:45

Dylan Parry wrote:

> Using a pointed stick and pebbles, rf scraped:
>
>>> document.write('<span onclick="myfunction(' + parameter + ')"></span>');
>>
>> or perhaps:
>>
>> document.write('<span onclick="myfunction(\"parameter\")"><span>');
>
> Hmm, I was reading the OP as something else, ie. how to dynamically add
> a parameter value using JavaScript to write the actual value based on a
> variable named "parameter" which needed to be inserted into the function
> call.

So I deduced. I took it the other way, as in eg
onclick="alert(\"I have been clicked\")"

A "real world" example by the OP may have been a better idea :-)

--
Cheers
Richard.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация