Ajax request with jQuery without WP_ajax
I solved my problem! In fact, jQuery can’t parse an element at the root stage. I just wrap all my body content into a div, and it works. I can also use filter function instead of find.
I solved my problem! In fact, jQuery can’t parse an element at the root stage. I just wrap all my body content into a div, and it works. I can also use filter function instead of find.
Use AS3’s ExternalInterface to call JavaScript functions from within Flash applications. import flash.external.ExternalInterface; if (ExternalInterface.available) ExternalInterface.call(“myJavascriptFunction”, param1, param2);
If the element that is being assigned the “click” event is “#social_trigger”, you cannot have more than one of these elements per page. You are searching for an “id” of an element and by definition, you can only have one element of a particular id per page. You should change your elements to have a … Read more
To accomplish this, wrap wp_enqueue_script in a function and run it through the action hook wp_enqueue_scripts while using the ‘priority’ parameter available in add_action to set the load order. function these_go_first() { wp_enqueue_script(‘first_script’, ‘[path to file]/first.js’, array(‘jquery’), ‘1.0’ ); } function these_go_first() { wp_enqueue_script(‘after_script’, ‘[path to file]/after.js’, array(‘jquery’, ‘first_script’), ‘1.0’ ); } add_action(‘wp_enqueue_scripts’, ‘these_go_first’, 1); … Read more
<script language=”javascript” type=”text/javascript” src=”https://wordpress.stackexchange.com/questions/30944/wp-content/themes/metric /scripts/jquery-1.4.1.min.js”></script> <link rel=”stylesheet” href=”wp-content/themes/metric/lavalamp.css” type=”text/css” media=”screen” /> <script type=”text/javascript” src=”wp-content/themes/metric/scripts/jquery.easing.min.js”></script> <script type=”text/javascript” src=”wp-content/themes/metric/scripts/jquery.lavalamp.min.js”></script> <script type=”text/javascript”> jQuery(function() { jQuery(‘#nav’).lavaLamp({ fx: ‘backout’, speed: 700, click: function(event, menuItem) { return true; } }); }); </script>
Where are you attaching this listener: $(‘#fluffyRabbit’).live(‘click’,function() { alert(‘o hai!’); }); I suppose that if you attach within a $(document).ready(function(){ //attach here $(‘#fluffyRabbit’).live(‘click’,function() { alert(‘o hai!’); }); }; that would do the trick. Is it working for you?
i usally first deregister to avoid duplicates, then register it and enqueue it like so: function my_scripts_method() { wp_deregister_script( ‘jquery’ ); wp_register_script( ‘jquery’, ‘http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js’); wp_enqueue_script( ‘jquery’ ); } add_action(‘wp_enqueue_scripts’, ‘my_scripts_method’); Hope this helps, Sagive.
Looks like you’re missing the jQuery ready function. Try this: jQuery(document).ready(function($){ $.delegate(‘p’,’mouseover’, function(e){ $(“#yyy a.tippy_link”).css(“background-color”,”yellow”); }); $.delegate(‘p’,’mouseout’, function(e){ $(“#yyy a.tippy_link”).css(“background-color”,”red”); }); }); Cheers,
one possibility – add a filter to functions.php of your theme: add_filter ( ‘wp_list_categories”https://wordpress.stackexchange.com/questions/58006/,”span_before_link_list_categories’ ); function span_before_link_list_categories( $list ) { $list = str_replace(‘<a href=”https://wordpress.stackexchange.com/questions/58006/,”<span>|</span><a href=”,$list); return $list; }
If you need to add it in the head, then this might help you: <?php add_action(‘wp_head’, ‘add_attr’); function add_attr(){ ?> <script data-cfasync=”false” type=”text/javascript” src=”http://use.typekit.com/YOUR-KIT-ID.js”></script> <script data-cfasync=”false” type=”text/javascript”>try{Typekit.load();}catch(e){}</script> <?php } ?> Make sure your theme has the wp_head function call. You’ll need wp_enqueue_scripts or wp_register_scripts only if your JS code in in some other .js file … Read more