473,549 Members | 2,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

document.getEle mentbyID('TICKE R') has no properties

8 New Member
Hi,

My website (http://www.justiceinmexico.org/indextest.php) looks good in Firefox, but horrible in IE, and I think it's because of an error in the javascript of a free web ticker I got off the internet.

When I run Firebug on it, it says:

document.getEle mentById("TICKE R") has no properties
TICKER_CONTENT = document.getEle mentById("TICKE R").innerHTM L;
Here is the complete script:
Expand|Select|Wrap|Line Numbers
  1. // WebTicker by Mioplanet
  2. 3// www.mioplanet.com
  3. 4
  4. 5TICKER_CONTENT = document.getElementById("TICKER").innerHTML;
  5. 6
  6. 7TICKER_RIGHTTOLEFT = false;
  7. 8TICKER_SPEED = 1;
  8. 9TICKER_STYLE = "font-family:Arial; font-size:12px; color:#444444";
  9. 10TICKER_PAUSED = false;
  10. 11
  11. 12ticker_start();
  12. 13
  13. 14function ticker_start() {
  14. 15 var tickerSupported = false;
  15. 16 TICKER_WIDTH = document.getElementById("TICKER").style.width;
  16. 17 var img = "<img src=ticker_space.gif width="+TICKER_WIDTH+" height=0>";
  17. 18
  18. 19 // Firefox
  19. 20 if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("Safari")!=-1) {
  20. 21 document.getElementById("TICKER").innerHTML = "<TABLE cellspacing='0' cellpadding='0' width='100%'><TR><TD nowrap='nowrap'>"+img+"<SPAN style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'>&nbsp;</SPAN>"+img+"</TD></TR></TABLE>";
  21. 22 tickerSupported = true;
  22. 23 }
  23. 24 // IE
  24. 25 if (navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1) {
  25. 26 document.getElementById("TICKER").innerHTML = "<DIV nowrap='nowrap' style='width:100%;'>"+img+"<SPAN style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'></SPAN>"+img+"</DIV>";
  26. 27 tickerSupported = true;
  27. 28 }
  28. 29 if(!tickerSupported) document.getElementById("TICKER").outerHTML = ""; else {
  29. 30 document.getElementById("TICKER").scrollLeft = TICKER_RIGHTTOLEFT ? document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth : 0;
  30. 31 document.getElementById("TICKER_BODY").innerHTML = TICKER_CONTENT;
  31. 32 document.getElementById("TICKER").style.display="block";
  32. 33 TICKER_tick();
  33. 34 }
  34. 35}
  35. 36
  36. 37function TICKER_tick() {
  37. 38 if(!TICKER_PAUSED) document.getElementById("TICKER").scrollLeft += TICKER_SPEED * (TICKER_RIGHTTOLEFT ? -1 : 1);
  38. 39 if(TICKER_RIGHTTOLEFT && document.getElementById("TICKER").scrollLeft <= 0) document.getElementById("TICKER").scrollLeft = document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth;
  39. 40 if(!TICKER_RIGHTTOLEFT && document.getElementById("TICKER").scrollLeft >= document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth) document.getElementById("TICKER").scrollLeft = 0;
  40. 41 window.setTimeout("TICKER_tick()", 30);
  41. 42}
  42. 43
Aug 20 '07 #1
13 4920
pbmods
5,821 Recognized Expert Expert
Heya, Rommel. Welcome to TSDN!

Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.

Does the TICKER element exist at the time that the browser evaluates this JavaScript?
Aug 20 '07 #2
RommelTJ
8 New Member
Heya, Rommel. Welcome to TSDN!

Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.

Does the TICKER element exist at the time that the browser evaluates this JavaScript?
Sorry about that. I apologize for not using the code tags. I read the forum guidelines, but I didn't read the Reply guidelines. I can see them now.

I don't know. I'm a noobie at this. I just copy pasted the free javascript ticker to my website and it messed it up on IE, but not on Firefox.

How can I check if the TICKER element exists at the time that the browser evaluates it?

I think the answer is no, because Firebug doesn't detect an error immediately, it takes about 2 minutes to come up with the error. Sorry for sounding completely clueless, but I am.

By the way, I used the search bar first and it seems that many people hve this problem. However, since I don't know js I can't fix it.
Aug 20 '07 #3
gits
5,390 Recognized Expert Moderator Expert
hi ...

there has to be a html-element with the id="TICKER" at your page ... assure that, may be you should refer to the page from where you copied the script.

when do you call the script ... during the load-time of the page or in the body onload event? you should always use the onload-event of the body since the dom of your page is ready to use at this time.

kind regards
Aug 20 '07 #4
RommelTJ
8 New Member
It's inside the body of the html inside a table. Here is the html:

Expand|Select|Wrap|Line Numbers
  1.  <table border="0" width="266">
  2.         <tr>
  3.         <td width="5%"><p><script type="text/javascript" src="webticker_lib.js" language="javascript"></script>
  4.         </p>
  5.  
  6.  
  7.  
  8.         <!-- TICKER IS HERE -->
  9.         <DIV ID="TICKER" STYLE="display:none; border-top:1px solid #CCCCCC; border-bottom:1px solid #CCCCCC; overflow:hidden; background-color:#FFFFFF; width:250px" onmouseover="TICKER_PAUSED=true" onmouseout="TICKER_PAUSED=false">
  10.  
  11.  
  12.  
  13.         <span style='background-color:#0088FF;'> &nbsp; &nbsp; <B><font color=#ffffff> News and Announcements:</font></a></B>&nbsp; &nbsp; </span>
  14.         <span style='background-color:#006633;'> &nbsp; &nbsp; 
  15.             <B><A href="/news/recent_news.php"><font color=#ffffff> Read our Latest News Report: July 2007</font></a></B>&nbsp; &nbsp; </span>
  16.         <span style='background-color:#CCCCCC;'> &nbsp; &nbsp; 
  17.             <B><A href="/events/seguridad_publica_y_reforma_penal_en_mexico.php"><font color=#ffffff> Recent Event: Seguridad Publica y Reforma Penal en Mexico</font></a></B>&nbsp; &nbsp; </span>
  18.         <span style='background-color:#CC0000;'> &nbsp; &nbsp; 
  19.             <B><A href="/events/binational_forum_on_alternative_criminal_justice.php"><font color=#ffffff> Recent Event: Binational Forum on Alternative Criminal Justice</font></a></B>&nbsp; &nbsp; </span>&nbsp; 
  20.         <span style='background-color:#0088FF;'> &nbsp; &nbsp; 
  21.             <B><A href="http://www.justiceinmexico.org/search/index.php"><font color=#ffffff> Search</font></a></B>&nbsp; &nbsp; </span>
  22.         <span style='background-color:#006633;'> &nbsp; &nbsp; 
  23.             <B><A href="http://www.justiceinmexico.org/contact/index.php"><font color=#ffffff> Contact us/Subscribe</font></a></B>&nbsp; &nbsp; </span>
  24.         <span style='background-color:#CCCCCC;'> &nbsp; &nbsp; 
  25.             <B><A href="http://www.sandiego.edu/tbi/"><font color=#ffffff> USD: Trans-Border Institute</font></a></B>&nbsp; &nbsp; </span>        <span style='background-color:#FFFFFF;'> &nbsp; &nbsp;
  26.         <B><A href="http://www.mioplanet.com/rsc/newsticker_javascript.htm" target="Mio">Scrolling News Ticker</A>
  27. by <a href="http://www.mioplanet.com">Mioplanet</a></B>&nbsp;&nbsp;    </DIV>
  28.  
  29.     <script type="text/javascript" src="webticker_lib.js" language="javascript"></script>        </td>
  30.     </tr>
  31.     </table>    </td>
  32.   </tr>
  33. </table> 
Thank you for your help. It is much appreciated. I've been trying to fix this for weeks.

Note: for some reason, my post suddenly put all tags in bold.
Aug 20 '07 #5
RommelTJ
8 New Member
Help would be appreciated.
Aug 21 '07 #6
pbmods
5,821 Recognized Expert Expert
Heya, Rommel.

Try this. Remove this line (I think it's line 12 or so):
Expand|Select|Wrap|Line Numbers
  1. ticker_start();
  2.  
And then change your HTML slightly:
Expand|Select|Wrap|Line Numbers
  1. <body onload="ticker_start();">
  2.  
Aug 21 '07 #7
RommelTJ
8 New Member
Heya, Rommel.

Try this. Remove this line (I think it's line 12 or so):
Expand|Select|Wrap|Line Numbers
  1. ticker_start();
  2.  
And then change your HTML slightly:
Expand|Select|Wrap|Line Numbers
  1. <body onload="ticker_start();">
  2.  
Thanks, but where should I put the HTML code?
Aug 22 '07 #8
pbmods
5,821 Recognized Expert Expert
Heya, Rommel.

Replace the body declaration ('<body>') in your code with the new code. There is always only one body tag per HTML file.
Aug 22 '07 #9
RommelTJ
8 New Member
Heya, Rommel.

Replace the body declaration ('<body>') in your code with the new code. There is always only one body tag per HTML file.
Oh. Duh.

I already load the common images there and it's a relatively large list under the parenthesis. I put a comma and added the code you gave me, but it still shows up wrong.

Actually, Firebug stopped detecting an error, but IE says there is an error in loading an object in line 6 Char 1. I went to line 6, but those are only common pictures and they were working before.

In any case, the site still looks bad on IE but good on firefox.
Aug 23 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1882
by: CJ | last post by:
Hi In my PHP script I'm able to update bookmarks without in hassles but document properties just don't work! I know in VB custom properties can be changed with the following: wdApp.ActiveDocument.CustomDocumentProperties(MyProperty) = "NewValue"
3
1822
by: StrongBad | last post by:
Does anyone know of a way to access the document properties of an office document using ASP? I need to be able to read things like the Title, Author, and Comments fields and pull that information into a web page. Any help is greatly appreciated. Thanks!! Eric
1
2132
by: Patrick Conway | last post by:
Hi! I'm building a Windows form that allows users to view a list of files (and their properties(metadata)) stored in a certain directory. All of the files in the directory are a result of a mail merge created in another process. In the Merge process, I used "BuiltInDocumentProperties"
0
938
by: clintonG | last post by:
Does somebody have code or documented methodology that will audit controls in the framework to generate the names and values for the properties each control uses? <%= Clinton Gallagher METROmilwaukee (sm) "A Regional Information Service" NET csgallagher AT metromilwaukee.com URL http://metromilwaukee.com/ URL...
0
1446
by: Alan T | last post by:
I have modified custom properties of a Word document by code. And there are fields in this Word document link to the properties, however, after running the application and reopen the document, the field values are still the old value until I right click the field and select 'Update field', then the new value will populate the field.
4
1278
by: Morgan | last post by:
Hello! I'm trying to find out if it's possible to access the properties of an document uploaded via the fileupload control? The end goal is to dynamically insert the number of pages in a document into a database field when the file is uploaded, along with the filename and mime property. TIA! -- Morgan Web Developer
0
1117
by: Support | last post by:
Hello: Apparently we can read and write to Document Properties using Dsofile.dll (seel http://support.microsoft.com/?id=224351) My question is: can this be extended to non-native Microsoft files. For example, tiff files. And if so, what should I look for in VB.NET to read and write to those fileds
3
5926
by: Maurizio | last post by:
I create an application with Access 2000 and I wish to read/write the properties of a specified word document. I use dsofile.dll my code is Function fGetDocProps(strInFile As String, strProp As String) Dim objWord As Object, objDocProps As Object On Error GoTo Err_fGetDocProps Set objWord = CreateObject("Word.Application") ...
0
1387
by: hannahhhh1056 | last post by:
Hello! I´m trying to create a makro that finds the text in a wddocument formatted as "heading 1" and then puts it in the document properties. I know how to get the text into doc properties but i see more problems when i try to find the text formatted as heading. As you see below i will have the headingtext as a string and just put in document...
0
7518
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7715
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7956
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7808
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5087
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1935
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1057
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.