Class JQueryUtils
- java.lang.Object
-
- com.googlecode.wicket.jquery.core.utils.JQueryUtils
-
public class JQueryUtils extends Object
Utility class for javascript / jQuery statements- Author:
- Sebastien Briquet - sebfz1
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringdetach(String selector)Gets the statement that detaches the element matching the current selector from the DOM.
The#detachmethod is the same as#remove, except that#detachkeeps all jQuery data associated with the removed elements.
This method is useful when removed elements are to be reinserted into the DOM at a later time.static Stringremove(String selector)Gets the statement that removes the element matching the current selector from the DOM.
Use#removewhen you want to remove the element itself, as well as everything inside it.
In addition to the elements themselves, all bound events and jQuery data associated with the elements are removed.
To remove the elements without removing data and events, use#detachinstead.static Stringtrycatch(String statement)Wraps a js statement into a try-catch blockstatic Stringtrycatch(String statement, boolean warn)Wraps a js statement into a try-catch block
-
-
-
Method Detail
-
trycatch
public static String trycatch(String statement)
Wraps a js statement into a try-catch block- Parameters:
statement- the js statement- Returns:
- the wrapped statement
-
trycatch
public static String trycatch(String statement, boolean warn)
Wraps a js statement into a try-catch block- Parameters:
statement- the js statementwarn- whether a warn should be logged to the console- Returns:
- the wrapped statement
-
detach
public static String detach(String selector)
Gets the statement that detaches the element matching the current selector from the DOM.
The#detachmethod is the same as#remove, except that#detachkeeps all jQuery data associated with the removed elements.
This method is useful when removed elements are to be reinserted into the DOM at a later time.- Parameters:
selector- the jQuery selector- Returns:
- the statement
- See Also:
remove(String)
-
remove
public static String remove(String selector)
Gets the statement that removes the element matching the current selector from the DOM.
Use#removewhen you want to remove the element itself, as well as everything inside it.
In addition to the elements themselves, all bound events and jQuery data associated with the elements are removed.
To remove the elements without removing data and events, use#detachinstead.- Parameters:
selector- the jQuery selector- Returns:
- the statement
- See Also:
detach(String)
-
-