Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 当从NextJS使用路由器时,mobile chrome浏览器本机共享按钮仅复制不带查询字符串的url_Android_Html_Google Chrome_Next.js - Fatal编程技术网

Android 当从NextJS使用路由器时,mobile chrome浏览器本机共享按钮仅复制不带查询字符串的url

Android 当从NextJS使用路由器时,mobile chrome浏览器本机共享按钮仅复制不带查询字符串的url,android,html,google-chrome,next.js,Android,Html,Google Chrome,Next.js,我研究了这个解决方案 我试过这个片段 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge

我研究了这个解决方案

我试过这个片段

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="canonical" href="http://localhost:3000">
    <title>Test Website</title>
    <script src="./jquery.min.js"></script>
</head>

<body>
    Hey shan <br> <br>

    <button id="btn">Click me</button>

    <script>
        $(document).ready(function () {
            $('#btn').click(function () {
                history.pushState({urlPath:'/'}, "/",  "/1234?name=shan&color=87878");
            });
        });
    </script>
</body>

</html>
问题是当用户单击路由器按钮时。用参数调用replace,除本机共享外,所有操作都正常,仅复制url
http://localhost:3000/1234
不是查询字符串

但当我使用浏览器上的“复制”按钮或“编辑”按钮时,查询字符串会被复制


我不知道如何处理这个问题,可能是什么问题?是否有任何元标记会阻止复制queryparam?

请尝试根据您提到的帖子更改规范url,并在mobile中尝试一次。这对我有用。但是由于某些原因,即使我们提供了规范的url,发布的localhost代码也会起作用并选择querystring。但是,对于一些实际的站点,我修改并检查了它,当提供给其他站点时,它采用规范的url,否则它采用实际的url。你有没有在实际的网站上尝试过,而不是使用你发布的localhost代码片段?是的,我现在尝试过,它就是这样工作的!尝试根据您提到的帖子更改规范url,并在mobile中尝试一次。这对我有用。但是由于某些原因,即使我们提供了规范的url,发布的localhost代码也会起作用并选择querystring。但是,对于一些实际的站点,我修改并检查了它,当提供给其他站点时,它采用规范的url,否则它采用实际的url。你有没有在实际的网站上尝试过,而不是使用你发布的localhost代码片段?是的,我现在尝试过,它就是这样工作的!
buttonClick = Router.replace(...)