[jQuery] Re: Calling a function from a non-jQuery .JS file

2009-04-16 Thread kiusau
document.ElementById has a bug in ie6 and ie7 that will return an element with a name attribute of the same value.  Use $('#today') instead. Got it. Thanks! todayEl.innerHTML = something can cause memory leaks if events are added to DOM objects inside of todayEl and then just written over

[jQuery] Re: Calling a function from a non-jQuery .JS file

2009-04-15 Thread Klaus Hartl
On 14 Apr., 19:15, dhtml dhtmlkitc...@gmail.com wrote: problem is that that Dreamweaver method is using document.write which can cause a problem depending on where the function is being called and which is usually avoided in jQuery land. Calling document.write in a jQuery ready callback

[jQuery] Re: Calling a function from a non-jQuery .JS file

2009-04-15 Thread kiusau
With minor modifications I was able to achieve my goal with the sample code that you provided. So that I do not feel compelled to ask this question could you confirm or disconfirm whether the below statement is correct. In order to create a jQuery method from a JavaScript function not encoded

[jQuery] Re: Calling a function from a non-jQuery .JS file

2009-04-15 Thread kiusau
Thank you for the warning with regard to the use of the document.write statement and the alternative format for writing text to an HTML document. It will likely prove invaluable in the future. Roddy

[jQuery] Re: Calling a function from a non-jQuery .JS file

2009-04-15 Thread kiusau
If you want to format a local date, . . . var todayEl = document.getElementById(today); todayEl.innerHTML = formatDate(new Date); // [1] [1]http://www.jibbering.com/faq/#formatDate This also worked, but produced a format very different from that required by the context in which the date

[jQuery] Re: Calling a function from a non-jQuery .JS file

2009-04-15 Thread Josh Powell
...what is wrong with just having:- var todayEl = document.getElementById(today); todayEl.innerHTML = formatDate(new Date); document.ElementById has a bug in ie6 and ie7 that will return an element with a name attribute of the same value. Use $('#today') instead. todayEl.innerHTML =

[jQuery] Re: Calling a function from a non-jQuery .JS file

2009-04-14 Thread MorningZ
So what is the error? And realize something: jQuery *is* JavaScript, don't think of it like two different things On Apr 14, 4:21 am, kiusau kiu...@mac.com wrote: I am new to jQuery, but understand enough to have already begun targeted experimentation.  I have run into a snag.  In brief, I am

[jQuery] Re: Calling a function from a non-jQuery .JS file

2009-04-14 Thread Klaus Hartl
On 14 Apr., 15:41, MorningZ morni...@gmail.com wrote: So what is the error The error is obviously that toDate is not a jQuery method. Another problem is that that Dreamweaver method is using document.write which can cause a problem depending on where the function is being called and which is

[jQuery] Re: Calling a function from a non-jQuery .JS file

2009-04-14 Thread mkmanning
Your calling toDate() as a method on the jQuery object, which it isn't; it's simply a function that prints out the date (and you should maybe rethink the document.write, it's deprecated). If you want the output to appear as the content of the element with id 'today' then do something like

[jQuery] Re: Calling a function from a non-jQuery .JS file

2009-04-14 Thread dhtml
On Apr 14, 8:58 am, Klaus Hartl klaus.ha...@googlemail.com wrote: On 14 Apr., 15:41, MorningZ morni...@gmail.com wrote: So what is the error The error is obviously that toDate is not a jQuery method. Another Right. problem is that that Dreamweaver method is using document.write which