Skip to main content

Posts

Access parent"s parent from javascript object

Somthing like var life= { users : { guys : function(){ this.SOMTHING.mameAndDestroy(this.girls); }, girls : function(){ this.SOMTHING.kiss(this.boys); }, }, mameAndDestroy : function(group){ }, kiss : function(group){ } }; this.SOMTHING is what I imagine the format is, but it might not be. What will step back up to the parent of an object? Source: Tips4all

Get an array of list element contents in jQuery

I have a structure like this: <ul> <li>text1</li> <li>text2</li> <li>text3</li> </ul> How do I use javascript or jQuery to get the text as an array? ['text1', 'text2', 'text3'] My plan after this is to assemble it into a string, probably using .join(', ') , and get it in a format like this: '"text1", "text2", "text3"' Source: Tips4all

jQuery Text to Link Script?

Does anyone know of a script that can select all text references to URLs and automatically replace them with anchor tags pointing to those locations? For example: http://www.google.com would automatically turn into <a href="http://www.google.com">http://www.google.com</a> Note: I am wanting this because I don't want to go through all my content and wrap them with anchor tags. Source: Tips4all

What"s the best way to calculate date difference in Javascript

I doing a function in Javascript like the VisualBasic DateDiff. You give two dates and the returning time interval (Seconds, Minutes, Days, etc...) DateDiff(ByVal Interval As Microsoft.VisualBasic.DateInterval, _ ByVal Date1 As Date, ByVal Date2 As Date) as Long So what's the best way to calculate the difference of Javascript Dates? Source: Tips4all