Current location: Hot Scripts Forums » General Web Coding » JavaScript » doubt in javascript


doubt in javascript

Reply
  #1 (permalink)  
Old 09-05-07, 01:14 AM
prakash_surekha prakash_surekha is offline
New Member
 
Join Date: Sep 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
doubt in javascript

hello friends,

i have written following javascript code but it works fine inIE but at attachevent it show error in firefox

javascript Code:
  1. addScrollSynchronization(divHeaderColumn, divContent, "vertical");
  2. function addScrollSynchronization(fromElement, toElement, direction) {
  3.     removeScrollSynchronization(fromElement);
  4.    
  5.     fromElement._syncScroll = getOnScrollFunction(fromElement);
  6.     fromElement._scrollSyncDirection = direction;
  7.     fromElement._syncTo = toElement;
  8.     toElement.attachEvent("onscroll", fromElement._syncScroll);
  9. }
  10.  
  11. // removes the scroll synchronization for an element
  12. function removeScrollSynchronization(fromElement) {
  13.     if (fromElement._syncTo != null)
  14.         fromElement._syncTo.detachEvent("onscroll", fromElement._syncScroll);
  15.  
  16.     fromElement._syncTo = null;
  17.     fromElement._syncScroll = null;
  18.     fromElement._scrollSyncDirection = null;
  19. }

anybody know where i am going wrong plz say me

Last edited by Christian; 09-05-07 at 01:21 AM. Reason: Please use [highlight=javascript] tags when posting JS code.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 09-05-07, 01:22 AM
Christian's Avatar
Christian Christian is offline
Community VIP
 
Join Date: Mar 2005
Location: ProgrammingTalk
Posts: 2,449
Thanks: 0
Thanked 6 Times in 5 Posts
Moved to Javascript.

Welcome to PT!
__________________
:: ImperialBB :: New version in the works! :: http://www.imperialbb.com ::

:: Have a question about the board? The Rules? An Infraction/Warning? :: Contact Form ::
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 09-05-07, 03:08 PM
jfulton's Avatar
jfulton jfulton is offline
Community VIP
 
Join Date: Apr 2006
Location: Los Angeles, CA
Posts: 660
Thanks: 0
Thanked 0 Times in 0 Posts
Try using a custom cross-browser method like Jon Resig's addEvent().
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 09-05-07, 03:53 PM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
Yes, the attachEvent call is the problem since it doesn't exist in FF.

Btw, if you know there's an error, please include the whole error message (and preferable the whole code) when posting. It can reduce the time it takes to analyze the problem to a few seconds in most cases.
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add javascript after load? <?Wille?> JavaScript 14 03-31-06 05:52 AM
Mixing some HTML into some JavaScript thatonedude JavaScript 2 12-30-05 12:04 PM
javascript /forms /checkboxes /arrays ski_woman JavaScript 1 11-16-04 05:08 AM
Order of vbscript and javascript in ASP marlin ASP 0 06-03-04 04:01 PM
Reaaly stuck about javascript over frames muratisik JavaScript 1 12-14-03 12:58 PM


All times are GMT -5. The time now is 12:47 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.