简体   繁体   English

如何添加jReject-jQuery浏览器拒绝到Joomla1.5网站

[英]How to add jReject - jQuery Browser Rejection into Joomla1.5 web site

I want to add jReject - jQuery Browser Rejection into my Joomla website. 我想将jReject-jQuery Browser Rejection添加到我的Joomla网站中。 I just try out with adding JS files to my template folder and it doesnt work for me. 我只是尝试将JS文件添加到模板文件夹中,但对我来说不起作用。

jReject - jQuery Browser Rejection jReject-jQuery浏览器拒绝

How can I add browser compatibility warning to my web site. 如何向我的网站添加浏览器兼容性警告。 Any suggestions 有什么建议么

I have added jquery.reject.js and jquery.reject.css into my template(gantry) 我已经将jquery.reject.jsjquery.reject.css添加到我的模板中(龙门)

I have put <head></head> tags in my index.php and inside the those tags, added the following: 我将<head></head>标记放入了index.php中,并在这些标记中添加了以下内容:

<link rel="stylesheet" type="text/css" href="jquery.reject.css" />
<script type="text/javascript" src="templates/gantry/js/jquery.reject.min.js"></script>   
<script language="javascript" type="text/javascript">
        $(document).ready(function{
            $.reject({
                reject: {
                    safari: true, // Apple Safari
                    chrome: true, // Google Chrome
                    firefox: true, // Mozilla Firefox
                    msie: true, // Microsoft Internet Explorer
                    opera: true, // Opera
                    konqueror: true, // Konqueror (Linux)
                    unknown: true // Everything else
                }
            }); // Customized Browsers    
            return false;
        });

</script> 

remember that Joomla is shipped with Mootools. 请记住,Joomla随Mootools一起提供。
As you might know, both Mootools and jQuery share dollar sign $ as shorthand for their functions, so remember to call jQuery.noConflict() or you're going to have some errors. 您可能知道,Mootools和jQuery均使用美元符号$作为其功能的简写,因此请记住调用jQuery.noConflict()否则会出现一些错误。

Since you want to display the popup only on some pages, you should create a module (maybe in an hidden position) and assign it to homepage only. 由于您只想在某些页面上显示弹出窗口,因此您应该创建一个模块(可能处于隐藏位置),并将其仅分配给主页。
Please be aware that some text editor will strip away your javascript, so the best thing to do is to write plain text without any editors. 请注意,某些文本编辑器会删除您的JavaScript,因此最好的做法是在不使用任何编辑器的情况下编写纯文本。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM