Author |
Topic  |
|
thermal_seeker
Junior Member
 
United Kingdom
430 Posts |
Posted - 10 June 2010 : 12:10:18
|
I have a problem where I set up a test announcement and it worked well, scrolling away happily. I went into the admin options and deleted the test message and tried to put another up. The table is there but no scrolling announcement. I have checked the database and the details are in there. I am also getting IE throwing up an error..
Message: Unterminated string constant Line: 207 Char: 206 Code: 0 URI: http://www.kdaf.co.uk/Forum/default.asp
when I delete the announcement the table goes away as it should and the error goes away
Line 207 in my default.asp is an "end if"
any ideas what could be wrong??
Dave |
No good at coding, but I can plough a field !! |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 11 June 2010 : 04:47:35
|
I'm not familiar with the mod, but, at a guess, I'd say the JavaScript was choking on a character (e.g., " or ') in your announcement that isn't being escaped before being passed to it.
Incidentally, that error is a JS error, not an ASP error so you need to refer to the generated HTML to find the error. For a more detailed error message, use Firefox's error console.
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
thermal_seeker
Junior Member
 
United Kingdom
430 Posts |
Posted - 11 June 2010 : 09:09:47
|
Thanks Shaggy
the error is showing as an unterminated string literal document.write('<Div align="center"><View_announcements.asp><strong>........
I have found a matching piece of code in inc_announce lines 80-87
but I'm unsure what I should do to cure my error as I do seem to have an ' at each end within the brackets.
Dave
Edit for typo |
No good at coding, but I can plough a field !! |
Edited by - thermal_seeker on 11 June 2010 09:10:59 |
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 11 June 2010 : 10:11:43
|
If you have a ' in the A_MESSAGE field, it's going to throw that error as it's not being escaped. Have a look at what's being done with the A_SUBJECT field and you'll notice that all 's are being replaced with #39;. On a side note, I find it much easier to escape the 's with a backslash, makes it easier to read back at a later date - so, instead of replacing them with #39;, you'd replace them with \'.
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
thermal_seeker
Junior Member
 
United Kingdom
430 Posts |
Posted - 11 June 2010 : 12:59:58
|
Thanks Shaggy, The #39; only appears if a ' is in the subject field if it is in the message field there is a blank table, no scrolling text.........In the message field I changed my text and replaced Kazzy's with Kazzy"s and the text appeared and scrolled away. I have been playing around and found it doesn't like : or ) or even a return put in for a new line. If you put in 5 spaces after a piece of text it will display as one space.(all in the subject field) : , ) and spaces all display in the subject field ok
This looks as though it is way beyond my capabilities to sort.
Dave |
No good at coding, but I can plough a field !! |
Edited by - thermal_seeker on 11 June 2010 13:01:52 |
 |
|
thermal_seeker
Junior Member
 
United Kingdom
430 Posts |
Posted - 11 June 2010 : 13:20:30
|
In an addition... I changed "#39:" in inc_announce to "\'" and in the subject field the ' now displays correctly.
Does this mean that an extra line has to be put in somewhere so that the message box displays correctly??
sorry for my ignorance here but I am trying to learn....
Dave |
No good at coding, but I can plough a field !! |
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
|
thermal_seeker
Junior Member
 
United Kingdom
430 Posts |
Posted - 11 June 2010 : 16:21:25
|
Thanks Huw, I have the ' working in the message field now by adding in the code in red.. document.write('<Div align="center"><View_announcements.asp><strong><%= replace(formatstr(rsAnnounce("A_SUBJECT")),"'","\'") %></strong></font><br><br><view_announcements.asp><%=replace(formatstr( rsAnnounce("A_message")),"'","\'") %><br></div><br>');
How do I add a further replace?? Is there a seperator between "'","\'" and ":","\:" or do I add an extra replace(formatstr (..... in
geez I hope you understood that...
well I'm not sure why but just adding that code in and everything is displaying as it should..... even the new lines......
Dave
edit for typo |
No good at coding, but I can plough a field !! |
Edited by - thermal_seeker on 11 June 2010 17:23:58 |
 |
|
|
Topic  |
|
|
|