小编pao*_*loi的帖子

HTML链接(如果已安装)启动应用程序;如果未安装,则访问网站

我有一个使用jQuery Mobile编写的移动网站,并且有社交图标。我想要的是,只有当用户在手机上安装了Facebook应用程序时,用户单击Facebook图标才能打开Facebook应用程序。如果用户在手机上没有该应用程序,那么我需要它去Facebook的移动网站。

我正在使用此链接打开应用程序:

<a href="fb://profile/212971392077465" class="facebook">My Fanpage</a>
Run Code Online (Sandbox Code Playgroud)

此方法有效,但是如果用户未安装这些应用程序,现在我需要代码帮助来打开移动网站。

理想情况下,这种技术应该适用于Twitter(我曾经使用twitter://status?id=12345过该应用程序)。

facebook mobile-application jquery-mobile web

5
推荐指数
0
解决办法
5815
查看次数

如何使用jQuery Validate插件测试Recaptcha

我正在使用验证jquery插件和recaptcha作为联系表单,我想知道如何在表单获取之前检查验证码中的代码是否正确如果没有发送错误消息,因为现在验证一切但我插入了错误的代码无论如何都要提交表单.这是我的代码ty提前为anyhelp

<script type="text/javascript">
             var RecaptchaOptions = {
                lang : 'en',
                theme : 'custom',
                custom_theme_widget: 'recaptcha_widget'
             };
            </script>

            <form id="contact" method="post" action="#">

                <fieldset>
                    <label for="name_contact">NAME</label>
                    <input type="text" class="input-xlarge" id="name_contact" name="name_contact" value="" placeholder="" minlength="2">

                    <label for="email_contact">EMAIL</label>
                    <input type="email" class="input-xlarge" id="email_contact" name="email_contact" value="" placeholder="">

                    <label for="telephone">CONTACT NUMBER</label>
                    <input type="tel" class="input-xlarge" id="telephone" name="telephone" placeholder="" value="" >

                    <label for="message">MESSAGE</label>
                    <textarea id="message" class="input-xlarge" name="message" placeholder="" rows="5"></textarea>                  

                    <div id="recaptcha_widget" style="display:none">

                        <div id="recaptcha_image"></div>
                        <div class="recaptcha_only_if_incorrect_sol" style="color:red">Incorrect please try again</div>

                        <span class="recaptcha_only_if_image">Enter the words above:</span>
                        <span class="recaptcha_only_if_audio">Enter the numbers …
Run Code Online (Sandbox Code Playgroud)

jquery jquery-validate recaptcha

3
推荐指数
1
解决办法
2万
查看次数

jQuery Validate插件不会删除错误消息

我"再次"询问jQuery Validate插件......

现在,我的问题是错误标签不会隐藏,直到我单击提交按钮一次,然后需要第二次单击提交表单,任何想法?如果我的输入文本有效,我需要的是错误标签隐藏.

jQuery的:

$("#form").validate({
            rules: {
                "name": {
                    required: true,
                    minlength: 3
                },
                "phone":{
                    required:true,
                    digits:true,
                    minlength: 9
                },
               "email":{
                    required: true
                },
                "storageoptions":{
                    required: true
                },
                "quantity":{
                    required:true,
                    digits:true
                }
            },
            messages: {
                "name": {
                    required: "Please enter a name"
                },
                "phone":{
                    required: "Required field"
                },
                "email":{
                    required: "Enter a valid email"
                },
                "storageoptions":{
                    required: "Please select an option"
                },
                "quantity":{
                    required: "This Field required"
                }               
            },
            errorPlacement: function(error, element) {
               error.insertBefore(element);
            },
            submitHandler: function (form) {    

               $.ajax({ …
Run Code Online (Sandbox Code Playgroud)

forms jquery jquery-validate

3
推荐指数
1
解决办法
3973
查看次数

mouseenter/mouseleave div扩展

我需要在鼠标悬停时扩展div,这种情况发生得相当好但是当鼠标离开div时却没有恢复正常

有些人来了我的档案http://jsfiddle.net/MyKnB/

$("#logo-expand").mouseenter(function() {
    $(this).animate({
        width: "56px;"
    }, 300 );
});

$("#logo-expand").mouseleave(function() {
    $(this).animate({
        width: "170px"
    }, 300 );
});
Run Code Online (Sandbox Code Playgroud)

jquery mouseenter mouseleave

1
推荐指数
1
解决办法
309
查看次数