473,725 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="javas cript">

function montre(id, shtml) {

if (document.getEl ementById) {

document.getEle mentById(id).st yle.visibility =
'visible';

} else if (document.all) {

document.all[id].style.visibili ty = 'visible';

} else if (document.layer s) {

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

};

var el = (document.getEl ementById)?
document.getEle mentById(id): (document.all)? document.all[id]:
(document.layer s)? document.layers[id]: null;

if (!el) return;

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

el.innerHTML = shtml;

} else if (document.layer s) {

el.document.wri te(shtml);ol

el.document.clo se();

} }

</script>

Now here is my asp function calling the javascript function:

<%

function loopDatasNews(c ol,arrayName)

nRowCount = ubound(arrayNam e, 2)

For n=0 to nRowCount

Increm = arrayName(col,n )

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

response.write( "<a class=""read""
href=""javascri pt:;""
onclick=""montr e('id"&n&"','"& Increm&"');"">r eadMore</a></td></tr></table><B
R>") //the error is in this line of code!

Next

End Function

%>
Jul 19 '05 #1
1 2574
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*****@videot ron.ca> wrote in message
news:Sm******** *************@w eber.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="javas cript">
:
: function montre(id, shtml) {
:
: if (document.getEl ementById) {
:
: document.getEle mentById(id).st yle.visibility =
: 'visible';
:
: } else if (document.all) {
:
: document.all[id].style.visibili ty = 'visible';
:
: } else if (document.layer s) {
:
: document.layers[id].visibility = 'visible';
:
: };
:
: var el = (document.getEl ementById)?
: document.getEle mentById(id): (document.all)? document.all[id]:
: (document.layer s)? document.layers[id]: null;
:
: if (!el) return;
:
: if (typeof el.innerHTML!=" undefined") {
:
: el.innerHTML = shtml;
:
: } else if (document.layer s) {
:
: el.document.wri te(shtml);ol
:
: el.document.clo se();
:
: } }
:
: </script>
:
: Now here is my asp function calling the javascript function:
:
: <%
:
: function loopDatasNews(c ol,arrayName)
:
: nRowCount = ubound(arrayNam e, 2)
:
: For n=0 to nRowCount
:
: Increm = arrayName(col,n )
:
: response.write( "<table
: class=""tableNe ws""><tr><td>"& arrayName(col-1,n)&"</td></tr><tr><td
: id='id"&n&"'>")
:
: response.write( "<a class=""read""
: href=""javascri pt:;""
:
onclick=""montr e('id"&n&"','"& Increm&"');"">r eadMore</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
6719
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 the sake of convenience (surely we learned this much from basic). here's my proposal: all "global" (document scope) variables must be declared by 'var' outside a function block.
6
5581
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 object collection and stanrd using it it starts to fall apart. Clearly there is something about javascript's usage of passing "By ref" that i am not getting. i have had a look on the web and found some examples, but i cant see why my code does not...
0
8888
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8097
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2157
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.