You appear to be a bot. Output may be restricted
Description
Dynamic jQuery setting the selector, function and option parametersNote: jQuery(document).ready( fn ) has been deprecated in jQuery 3.0
Usage
bw_jquery( $selector, $method, $parms, $windowload );
Parameters
- $selector
- ( string ) required – the jQuery selector
- $method
- ( string ) required – the jQuery method to invoke
- $parms
- ( string ) optional – parameters overriding the method's defaults
- $windowload
- ( bool ) optional – use true when you need to wait for images to load
Returns
voidSource
File name: oik/libs/bobbfunc.phpLines:
1 to 14 of 14
function bw_jquery( $selector, $method, $parms=null, $windowload=false ) { if ( defined('DOING_AJAX') && DOING_AJAX ) { return; } bw_jq( "<script type=\"text/javascript\">" ); if ( $windowload ) { $jqfn = 'jQuery(window).on( "load", function()'; } else { $jqfn = "jQuery( function()"; } $function = "$jqfn { jQuery( \"$selector\" ).$method( $parms ); });"; bw_jq( $function ); bw_jq( "</script>" ); }View on GitHub View on Trac