By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,394 Members | 1,443 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,394 IT Pros & Developers. It's quick & easy.

javascript function passing a vb variable

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.