P
Patrice
HI,
1- I fill an array (arrayName ) of records (news and news titles) from an
ACCESS database.
2- I call a function (loopDatasNews()) to build a table of news titles.
3- I call javascript function as to write a news when a "read more"
hyperlink under a new title is clicked
Here is my problem: An Error occurs each time an apostrophy or a ")" is in a
database record. This means that the javascript function doesn't work each
time an " ' " is encountered in the "Increm" ASP variable .
I tried to use :
Increm= cstr(arrayName(col,n)) but it still doesn't work
Does anyone know how to fix this?
Thank in advance
<%
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&"'><a class=""read"" href=""javascript:;""
onclick=""showNews('id"&n&"','"&Increm&"');"">readMore</a></td></tr></table>
<BR>")
Next
End Function
%>
<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>
Patrice Baudin
1- I fill an array (arrayName ) of records (news and news titles) from an
ACCESS database.
2- I call a function (loopDatasNews()) to build a table of news titles.
3- I call javascript function as to write a news when a "read more"
hyperlink under a new title is clicked
Here is my problem: An Error occurs each time an apostrophy or a ")" is in a
database record. This means that the javascript function doesn't work each
time an " ' " is encountered in the "Increm" ASP variable .
I tried to use :
Increm= cstr(arrayName(col,n)) but it still doesn't work
Does anyone know how to fix this?
Thank in advance
<%
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&"'><a class=""read"" href=""javascript:;""
onclick=""showNews('id"&n&"','"&Increm&"');"">readMore</a></td></tr></table>
<BR>")
Next
End Function
%>
<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>
Patrice Baudin