homepage Welcome to WebmasterWorld Guest from 54.204.94.228
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
datejs and jquery .clone() conflict?
nelsonm




msg:4494452
 7:37 pm on Sep 12, 2012 (gmt 0)

hi all,

I'm interested in using the datejs library but i noticed that it defines a ".clone()" method that looks exactly like jQuery's ".clone()" method.

Won't datejs mess up my use of jQuery's .clone() method if i install datejs on my site?

thanks.

 

daveVk




msg:4494570
 3:27 am on Sep 13, 2012 (gmt 0)

I assume the .clone() in datejs is not a method of a jQuery defined object, so there be no conflict ?

nelsonm




msg:4494780
 4:00 pm on Sep 13, 2012 (gmt 0)

I just don't see how there would not be a conflict. How would the browser's interpreter know which library to use (datejs or jquery) when it incounters ".clone()"?

daveVk




msg:4494942
 11:56 pm on Sep 13, 2012 (gmt 0)

datejs usage of clone() is like

var myDate = new Date();
var cloneDate = myDate.clone();

It has added a method called 'clone' to objects created with the Date Constructor.

So objects NOT created with the Date Constructor will not be effected, and are free to have a clone property of there own.

".clone()" only has meaning in the context of what object it follows.

nelsonm




msg:4494949
 12:26 am on Sep 14, 2012 (gmt 0)

interesting, i guess i don't understand how the interpreter figures it out so i'll take your word for it.

However, i'll try asap.

thanks.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved