[英]how to load jquery dialog in wordpress using wp_enqueue_script?
how can i load a jquery dialog once the page is loaded? 页面加载后如何加载jquery对话框? I mean I don't want to load it everytime i refresh the page.
我的意思是我不想每次刷新页面时都加载它。
I know it's something to do with cookies. 我知道这与Cookie有关。
here is my dialog 这是我的对话
var $j = jQuery.noConflict();
$j(function(){
$j(document).ready(function(){
$j('#west').dialog({show: 'slow', modal: true, height: 600, width: 850, title: 'Price Comparison Popup', resizable: false, draggable: false});
});
});
I'm not sure I fully understand your questions, but if you just want to add a jquery-ui script to your code, use something like: 我不确定我是否完全理解您的问题,但是如果您只想在代码中添加jquery-ui脚本,请使用以下命令:
//assuming you are working on a plugin
$plugin_url = plugins_url('myPlugin');
//register and enqueue the script
wp_register_script("jquery-dialog", $plugin_url . '/js/jquery.dialog.js', 'jquery');
wp_enqueue_style('jquery-dialog');
That will include the script, and make sure it is loaded after Wordpress's version of jQuery. 这将包括脚本,并确保在Wordpress的jQuery版本之后加载该脚本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.