thegiraffe
Programmer
I am trying to do a noticeboard, but calling it using java!
It works fine, i've got an onclick refresh page with thread id=thread, I have a script at the bottom of the page saying if thread <> empty etc build variable (which consists of a grid getting values from an sql table) and then calling the javascript at the very bottom of the page.
This all works, i was impressed first time!! Anyway things started to go pear shaped when i put the message field in, it works if the field has only one line with no enters, the problem is when you have more than one line with enters, i get the java error Unterminated string constant & sShowThread is undefined.
The code is like
<%
sShowThread = "<table>" ......i'll skip the other stuff
sShowThread = sShowThread & "<tr><td><span class=mainblack>" & objRsS("message"
& "</span></td></tr>"
sShowThread = sShowThread & "</table>"
response.write "<script LANGUAGE=""JavaScript"">sShowThread = """ & sShowThread & """</script>"
%>
<script language="JavaScript">
function ShowThread() {
document.getElementById('d1').innerHTML = sShowThread;
}
ShowThread();
</script>
d1 in the showthread function is the div area on the page where i'm putting the data.
This normally works but i must have to do something to the text for it to work, i've quickly tried to put it in an array split by vbcrlf and use it that way, but that doesn't seem to work either, unless its the way i'm doing it.
I need to do it like above because the whole page is set this way, so if someone hovers over a different section it then changes whats in the section.
Any ideas, any help, help, help me please!!! Dave
Theres nothing worse than an idea when its the only one we have!
It works fine, i've got an onclick refresh page with thread id=thread, I have a script at the bottom of the page saying if thread <> empty etc build variable (which consists of a grid getting values from an sql table) and then calling the javascript at the very bottom of the page.
This all works, i was impressed first time!! Anyway things started to go pear shaped when i put the message field in, it works if the field has only one line with no enters, the problem is when you have more than one line with enters, i get the java error Unterminated string constant & sShowThread is undefined.
The code is like
<%
sShowThread = "<table>" ......i'll skip the other stuff
sShowThread = sShowThread & "<tr><td><span class=mainblack>" & objRsS("message"
sShowThread = sShowThread & "</table>"
response.write "<script LANGUAGE=""JavaScript"">sShowThread = """ & sShowThread & """</script>"
%>
<script language="JavaScript">
function ShowThread() {
document.getElementById('d1').innerHTML = sShowThread;
}
ShowThread();
</script>
d1 in the showthread function is the div area on the page where i'm putting the data.
This normally works but i must have to do something to the text for it to work, i've quickly tried to put it in an array split by vbcrlf and use it that way, but that doesn't seem to work either, unless its the way i'm doing it.
I need to do it like above because the whole page is set this way, so if someone hovers over a different section it then changes whats in the section.
Any ideas, any help, help, help me please!!! Dave
Theres nothing worse than an idea when its the only one we have!