GVKun编程网logo

用户单击链接时如何运行PHP代码?(用户单击链接时如何运行php代码)

10

如果您对用户单击链接时如何运行PHP代码?感兴趣,那么本文将是一篇不错的选择,我们将为您详在本文中,您将会了解到关于用户单击链接时如何运行PHP代码?的详细内容,我们还将为您解答用户单击链接时如何运行

如果您对用户单击链接时如何运行PHP代码?感兴趣,那么本文将是一篇不错的选择,我们将为您详在本文中,您将会了解到关于用户单击链接时如何运行PHP代码?的详细内容,我们还将为您解答用户单击链接时如何运行php代码的相关问题,并且为您提供关于android – Branch.io:单击链接时深入链接到特定活动、Branch io:我应该如何配置链接,以便在用户单击尚未安装的 Android 应用程序的链接时打开默认应用程序市场?、c# – 单击链接时弹出、javascript – 当搜索字段失去焦点时,使搜索菜单消失,但仍允许用户单击链接的有价值信息。

本文目录一览:

用户单击链接时如何运行PHP代码?(用户单击链接时如何运行php代码)

用户单击链接时如何运行PHP代码?(用户单击链接时如何运行php代码)

我想让页面在用户单击链接时运行一些PHP代码,而不重定向它们。这有可能吗

<a href=""></a>

或使用javascript onclick事件?

答案1

小编典典

是的,您需要有一个onclick触发的javascript函数,该函数会对页面进行AJAX加载,然后返回false,这样就不会在浏览器中将其重定向。如果您的项目可以接受,则可以在jQuery中使用以下内容:

<script type="text/javascript" src="jquery.min.js"></script><script type="text/javascript">function doSomething() {    $.get("somepage.php");    return false;}</script><a href="#" onclick="doSomething();">Click Me!</a>

如果您需要使用表单值(使用$ .post()方法),也可以进行回发。

android – Branch.io:单击链接时深入链接到特定活动

android – Branch.io:单击链接时深入链接到特定活动

我成功创建了一个深层链接并将其发布到Facebook,并附上了所有相关的元数据:

TextView.OnClickListener inviteClickListener = new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        BranchUniversalObject branchUniversalObject = new BranchUniversalObject()
                // The identifier is what Branch will use to de-dupe the content across many different Universal Objects
                .setCanonicalIdentifier("item/12345")
                        // This is where you define the open graph structure and how the object will appear on Facebook or in a deepview
                .setTitle("Suits")
                .setContentDescription("Great suits here")
                .setContentimageUrl("http://steezo.com/wp-content/uploads/2012/12/man-in-suit.jpg")
                        // You use this to specify whether this content can be discovered publicly - default is public
                .setContentIndexingMode(BranchUniversalObject.CONTENT_INDEX_MODE.PUBLIC)
                        // Here is where you can add custom keys/values to the deep link data
                .addContentMetadata("picurl","http://steezo.com/wp-content/uploads/2012/12/man-in-suit.jpg");

        LinkProperties linkProperties = new LinkProperties()
                .setChannel("facebook")
                .setFeature("sharing")
                .addControlParameter("$desktop_url","http://www.yahoo.com")
                .addControlParameter("$ios_url","http://www.microsoft.com");

        ShareSheetStyle shareSheetStyle = new ShareSheetStyle(PlaceDetailsActivity.this,"Check this out!","This stuff is awesome: ")
                .setMoreOptionStyle(getResources().getDrawable(android.R.drawable.ic_menu_search),"Show more")
                .addPreferredSharingOption(SharingHelper.SHARE_WITH.FACEBOOK)
                .addPreferredSharingOption(SharingHelper.SHARE_WITH.EMAIL);

        branchUniversalObject.showShareSheet(PlaceDetailsActivity.this,linkProperties,shareSheetStyle,new Branch.BranchLinkShareListener() {
                    @Override
                    public void onShareLinkDialogLaunched() {
                    }
                    @Override
                    public void onShareLinkDialogdismissed() {
                    }
                    @Override
                    public void onLinkShareResponse(String sharedLink,String sharedChannel,BranchError error) {
                        Log.e("LinkShared","success");
                    }
                    @Override
                    public void onChannelSelected(String channelName) {
                    }
                });

        branchUniversalObject.generateShortUrl(PlaceDetailsActivity.this,new Branch.BranchLinkCreateListener() {
            @Override
            public void onLinkCreate(String url,BranchError error) {
                if (error == null) {
                    Log.i("MyApp","got my Branch link to share: " + url);
                }
            }
        });
    }
};

我没有成功做的是确保在点击链接时,它会转到我的应用程序中的正确活动.我密切关注了指南,但在某些方面我发现指南有点模糊 – https://dev.branch.io/references/android_sdk/#branch-universal-object-for-deep-links-content-analytics-and-indexing.

在我想要调用的活动中,我把它放在清单中:

<activity
        android:name=".Suitactivity"
        android:label=""
        android:windowSoftInputMode="adjustResize">
        <Meta-data android:name="io.branch.sdk.auto_link_keys_6" android:value="picurl" />
    </activity>

在Suitactivity类中,我输入以下内容:

@Override
protected void onResume() {
    super.onResume();
        if (Branch.isAutoDeepLinkLaunch(this)) {
            try {
        action.setPicurl(Branch.getInstance().getLatestReferringParams().getString("picurl"));

            } catch (JSONException e) {
                e.printstacktrace();
            }
        } else {
            Log.e("nondeeplink","Launched by normal application flow");
        }
}

这似乎是点击Facebook中的链接并打开我的Suitactivity而不是我的MainActivity所需要做的一切,但它似乎不起作用.当我点击分支链接时,它会打开MainActivity.

当我在Branch上创建链接时,这是日志中返回的内容:

2-16 19:44:38.019 24086-24086/com.example I/MyApp: got my Branch link to share: https://bnc.lt/cByh/7d3u8enomp
12-16 19:44:38.021 24086-24129/com.example I/BranchSDK: posting to https://api.branch.io/v1/url
12-16 19:44:38.021 24086-24129/com.example I/BranchSDK: Post value = {
                                                                                            "identity_id": "20569XXX","device_fingerprint_id": "20519XXX","session_id": "2057XXX","tags": [],"alias": "","channel": "Add to Facebook","feature": "sharing","stage": "","data": "{\"$og_title\":\"Suits\",\"$canonical_identifier\":\"item\\\/12345\",\"$keywords\":[],\"$og_description\":\"Great suits here\",\"$og_image_url\":\"http:\\\/\\\/steezo.com\\\/wp-content\\\/uploads\\\/2012\\\/12\\\/man-in-suit.jpg\",\"$content_type\":\"\",\"$exp_date\":\"0\",\"picurl\":\"http:\\\/\\\/steezo.com\\\/wp-content\\\/uploads\\\/2012\\\/12\\\/man-in-suit.jpg\",\"$desktop_url\":\"http:\\\/\\\/www.yahoo.com\",\"$ios_url\":\"http:\\\/\\\/www.microsoft.com\",\"source\":\"android\"}","sdk": "android1.10.1","retryNumber": 0,"branch_key": "key_test_XXX"
                                                                                        }

编辑:

我现在甚至已经添加了一个GitHub示例供您测试:https://github.com/Winghin2517/BranchIOTestDeepLink

它包括两个活动:

>使用FAB的MainActivity – 它是通过Android Studios创建的新应用程序的标准模板.如果您单击FAB,Branch.io将启动并要求您添加到Facebook,复制链接等.
> SecondActivity – 一旦你在Facebook上分享它并点击链接上的facebook,就应该开始SecondActivity.目前,当您点击Facebook上的链接或您共享它的所有位置时,该链接仍会打开MainActivity.

要使此示例正常工作,请同时将您的branch.IO密钥替换为您在清单中的配置文件中的密钥,它们只是XXX的:

<Meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_XXX" />
<Meta-data android:name="io.branch.sdk.BranchKey.test" android:value="key_test_XXX" />

谢谢!

解决方法

Github repo现在是一个有关Branch.io的Android的工作示例,经过几天来回与branch.io来回联系我终于得到了它的工作:

https://github.com/Winghin2517/BranchIOTestDeepLink

如果您点击Facebook中的链接或您决定发送链接的位置,该应用将打开“SecondActivity”,而不是“MainActivity”.如果您从’SecondActivity’单击后退,它将关闭应用程序,因为onActivityResult方法将在’MainActivity’中使用正确的活动代码调用,而finish()方法在’MainActivity’中调用以关闭应用程序.

Branch io:我应该如何配置链接,以便在用户单击尚未安装的 Android 应用程序的链接时打开默认应用程序市场?

Branch io:我应该如何配置链接,以便在用户单击尚未安装的 Android 应用程序的链接时打开默认应用程序市场?

我建议使用华为应用链接。统一链接功能允许您同时在 AppGallery 和 Google Play 详情页面上配置链接。不同的手机可以自动切换到相应的应用商店。 https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-applinking-unifiedlinking-0000001070790553

enter image description here

,

这里有一个 Branchster:

默认情况下,分支链接将重定向到华为应用程序库,无需任何特殊配置。这是因为谷歌和华为都使用相同的 URI 方案(market://details)来启动商店。在没有 PlayStore 的华为设备上,分支链接将触发相同的 URI 方案,并将用户路由到华为应用程序库。

c# – 单击链接时弹出

c# – 单击链接时弹出

单击链接时我需要弹出窗口.但是在页面加载中,弹出窗口显示在页面底部.我希望它仅在单击链接时显示.我在哪里做错了?请帮帮我们!我是学习者.非常感谢!

<cc1:ConfirmButtonExtender displayModalPopupID="ModalPopupExtender4" ID="ConfirmButtonExtender4"
                runat="server" TargetControlID="lnkremoveloc" Enabled="False" OnClientCancel="RemoveLocations">
            </cc1:ConfirmButtonExtender>
            <cc1:ModalPopupExtender ID="ModalPopupExtender4" OkControlID="btndisable" CancelControlID="btnCancel"
                BackgroundCssPopupControlID="pnlRemove" TargetControlID="lnkremoveloc"
                runat="server">
            </cc1:ModalPopupExtender>
            <asp:Panel CssID="PnlRemove" runat="server">
                <!-- Common Popup Control Begin -->
                <tablewidth="400" cellpadding="0" cellspacing="0">

                <tr>
                    <td>
                    </td>
                    <td>
                    </td>
                    <td>
                    </td>
                </tr>
                <tr>
                    <td colspan="5"align="center">--%>
                        <!-- Content Area Begin -->
                        <table>
                            <tr>
                                <td colspan="1"title="Select">

                                </td>
                                <td colspan="4"title="Location Name">

                                </td>
                            </tr>
                            <tr>
                                <td align="center" colspan="5">
                                    <input id="btndisable" type="button" value="disable"/>
                                    <input id="Cancel" type="button" value="Cancel"/>
                                </td>
                            </tr>
                        </table>
                        <!-- Content Area Ends -->
                    </td>
                </tr>
                <tr>
                    <tdhttps://www.jb51.cc/tag/ott/" target="_blank">ottomLeft">
                    </td>
                    <tdhttps://www.jb51.cc/tag/ott/" target="_blank">ottomMiddle">
                    </td>
                    <tdhttps://www.jb51.cc/tag/ott/" target="_blank">ottomright">
                    </td>
                </tr>
            </table>
            <!-- Common Popup Control End -->
       </asp:Panel>

解决方法

尝试改变

<asp:Panel ID="pnlPagePopup"https://www.jb51.cc/tag/dis/" target="_blank">display: none;" runat="server" >

<asp:Panel ID="pnlPagePopup" Visible="false" runat="server" >

javascript – 当搜索字段失去焦点时,使搜索菜单消失,但仍允许用户单击链接

javascript – 当搜索字段失去焦点时,使搜索菜单消失,但仍允许用户单击链接

On my website我有一个搜索框(文本输入字段).
当用户点击它并开始键入文本时,会出现一个链接菜单.
菜单通过JQuery显示 – 以下命令使菜单显示:

".focus(function() {
    $("#instant_search_wrapper").show();
}); "

当用户点击搜索框时,我希望菜单消失.

最简单的方法是使用以下命令:

".blur(function() {
    $("#instant_search_wrapper").hide();
});" 

但是,如果我这样做,那么当用户点击菜单中的链接时,文本输入字段会失去焦点,因此菜单会在用户进入选择页面之前消失.
当搜索字段失去焦点时,我怎样才能使菜单消失(但如果用户在搜索字段失去焦点之前点击链接,他/她仍然可以被带到链接)?

最佳答案
您需要将单击绑定到正文以进行隐藏

$(document).click(function() {
      $("#instant_search_wrapper").hide();

});

请参阅http://jsfiddle.net/WYbp3/4/的工作示例

今天关于用户单击链接时如何运行PHP代码?用户单击链接时如何运行php代码的讲解已经结束,谢谢您的阅读,如果想了解更多关于android – Branch.io:单击链接时深入链接到特定活动、Branch io:我应该如何配置链接,以便在用户单击尚未安装的 Android 应用程序的链接时打开默认应用程序市场?、c# – 单击链接时弹出、javascript – 当搜索字段失去焦点时,使搜索菜单消失,但仍允许用户单击链接的相关知识,请在本站搜索。

本文标签: