Forums Archive Index > Cool free scripts > Script stops working

Author: dbeaujon

Date: 9 Mar 2004 4:00 pm

Ok, this forum helped me a lot in setting up the v_newsticker with dynamic content. (PHP).
1. I have renamed the script to v_newsticker_1.php
2. linked the script in my html page.
3. contructed a php page that outputs the following (in sourcecode):

['http://www.****.com/news.php?newsid=5','<img src=images/body/arrow.gif align=top width=20 height=11 border=0>03/10/2004<br>The script for the news items is working','_self']
,['http://www.*****.com/news.php?newsid=4','<img src=images/body/arrow.gif align=top width=20 height=11 border=0>03/16/2004<br>Company launches its website!!!!','_self']

4. Now, just to build this up systematically I have copied the original script to the file to get that part running first, and then I would paste the php include in the content. When I tried running the original script (renamed to php extension) I would get the following error on my webpage:

div id=v_1 style='position:absolute;top:52px;left:2px;width:196px;height:48px;clip:rect(0,196,48,0);overflow:hidden;text-align:left' class=vnewsticker>Welcome to the V-NewsTicker example page! Presenting the best FREE vertical news scroller ever written.
div id=v_2 style='position:absolute;top:52px;left:2px;width:196px;height:48px;clip:rect(0,196,48,0);overflow:hidden;text-align:left' class=vnewsticker>Featuring: support for the most popular browsers, easy setup, small size, pausing, sliding up or down...
div id=v_3 style='position:absolute;top:52px;left:2px;width:196px;height:48px;clip:rect(0,196,48,0);overflow:hidden;text-align:left' class=vnewsticker>


5. My statusbar would show me this error:

Line: 57
Char: 562
Error: 'Document.All[...].style] is null or not an object
Code: 0

What is happening here and how should I correct it.

Darrell


Author: dbeaujon

Date: 9 Mar 2004 4:11 pm

One more thing I tried:

I copied the original v_newsticker_1.js file to my folder. Renamed it to v_newsticker_1.php and uploaded it to my website.

The script would work perfectly. The minute I touch any option (even delete one character from the domain link) I would would get the error message shown in my previous posting.


Author: smartmenus

Date: 10 Mar 2004 11:19 am

Your second post makes me think you are using some kind of text editor that applies word-wrap to the script file when it saves it. I am not completely sure this causes your problem but I have experienced such problems on Linux with some editors - if I select "Apply word-wrap" and save the script file after making some changes, it would break the script by adding new line symbols.

Anyway, what editor are you using? Or if you don't think the editor is the problem, please provide some address where an example could be seen.

Thanks!


Author: dbeaujon
Subject: Script is working!!!

Date: 10 Mar 2004 1:45 pm

You were absolutly right.
I'm using Dreamweaver MX and switch to windows notepad with word wrapping disabled, and voila!!!
I have build a content management system where my customers post their news item in a password protected area. The system works beautifully. One concern though; if one of my customers fill in an ' on the news item this would effectively break up the script. I know this is not part of the support but maybe you could point me in the direction of a solution where maybe a slash (\) gets inserted before each '.

Thanks for the support and this great script!


Author: smartmenus

Date: 10 Mar 2004 6:18 pm

dbeaujon wrote:
... if one of my customers fill in an ' on the news item this would effectively break up the script ... maybe you could point me in the direction of a solution where maybe a slash (\) gets inserted before each '.Inserting a back slash (\) before the quote will completely fix the problem. If you can do it, then it is OK. Another solution is to replace (') with (&#39;) for the items' text.

dbeaujon wrote:
Thanks for the support and this great script!No problem at all! That's my job. :D Please, let me know if you have any questions.

Thanks!