473,396 Members | 1,966 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

javascript function passing a vb variable

Hi,

I'm trying to use a javascript function passing a vb variable. I don't
understand why it doesn't work.

Can someone help me?

Thanks in advance.

Here is my javascript function used to show a text:

<script language="javascript">

function montre(id, shtml) {

if (document.getElementById) {

document.getElementById(id).style.visibility =
'visible';

} else if (document.all) {

document.all[id].style.visibility = 'visible';

} else if (document.layers) {

document.layers[id].visibility = 'visible';

};

var el = (document.getElementById)?
document.getElementById(id): (document.all)? document.all[id]:
(document.layers)? document.layers[id]: null;

if (!el) return;

if (typeof el.innerHTML!="undefined") {

el.innerHTML = shtml;

} else if (document.layers) {

el.document.write(shtml);ol

el.document.close();

} }

</script>

Now here is my asp function calling the javascript function:

<%

function loopDatasNews(col,arrayName)

nRowCount = ubound(arrayName, 2)

For n=0 to nRowCount

Increm = arrayName(col,n)

response.write("<table
class=""tableNews""><tr><td>"&arrayName(col-1,n)&"</td></tr><tr><td
id='id"&n&"'>")

response.write("<a class=""read""
href=""javascript:;""
onclick=""montre('id"&n&"','"&Increm&"');"">readMo re</a></td></tr></table><B
R>") //the error is in this line of code!

Next

End Function

%>
Jul 19 '05 #1
1 2556
Please post the error you are receiving. Is it a server-side error? (problem
with your ASP/VBScript code), or a client-side error (problem with passing
the arguments into the javascript function)?

Cheers
Ken

"Patrice" <ma*****@videotron.ca> wrote in message
news:Sm*********************@weber.videotron.net.. .
: Hi,
:
: I'm trying to use a javascript function passing a vb variable. I don't
: understand why it doesn't work.
:
: Can someone help me?
:
: Thanks in advance.
:
: Here is my javascript function used to show a text:
:
: <script language="javascript">
:
: function montre(id, shtml) {
:
: if (document.getElementById) {
:
: document.getElementById(id).style.visibility =
: 'visible';
:
: } else if (document.all) {
:
: document.all[id].style.visibility = 'visible';
:
: } else if (document.layers) {
:
: document.layers[id].visibility = 'visible';
:
: };
:
: var el = (document.getElementById)?
: document.getElementById(id): (document.all)? document.all[id]:
: (document.layers)? document.layers[id]: null;
:
: if (!el) return;
:
: if (typeof el.innerHTML!="undefined") {
:
: el.innerHTML = shtml;
:
: } else if (document.layers) {
:
: el.document.write(shtml);ol
:
: el.document.close();
:
: } }
:
: </script>
:
: Now here is my asp function calling the javascript function:
:
: <%
:
: function loopDatasNews(col,arrayName)
:
: nRowCount = ubound(arrayName, 2)
:
: For n=0 to nRowCount
:
: Increm = arrayName(col,n)
:
: response.write("<table
: class=""tableNews""><tr><td>"&arrayName(col-1,n)&"</td></tr><tr><td
: id='id"&n&"'>")
:
: response.write("<a class=""read""
: href=""javascript:;""
:
onclick=""montre('id"&n&"','"&Increm&"');"">readMo re</a></td></tr></table><B
: R>") //the error is in this line of code!
:
: Next
:
: End Function
:
: %>
:
:
Jul 19 '05 #2

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

Similar topics

10
by: Andy Fish | last post by:
Hi, can anybody put forward a sensible argument javascript's behaviour of creating a new global variable whenever I assign to a previously undeclared variable. I can't beleive this is just for...
6
by: ged | last post by:
Hi, i am a oo (c#) programmer, and have not used javascript for a while and i cant work out how javascript manages its references. Object References work for simple stuff, but once i have an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
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,...

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.