鍍金池/ 問答/ HTML問答
厭惡我 回答

好幾天沒人回答,職能用最笨的辦法,既然一定要報(bào)錯(cuò),那就在catch里返回登錄界面好了
if (PWD.equals(pw)) {

        response.sendRedirect(request.getContextPath()+"/Main.jsp?user_id="+id+"&user_name="+na+"&user_c="+competence);
    }else{
        response.sendRedirect(request.getContextPath()+"/Login.jsp?error=PasswordError");
    }
    session.close();
    } catch (Exception e) {
        response.sendRedirect(request.getContextPath()+"/Login.jsp?error=IdError");            
    }
巷尾 回答

就是username和passport這個(gè)字段有可能有,有可能沒有?

interface Wechat {
    username?:Validate;
    password?:Validate;
}
interface Validate {
        defaultValue:string,
        allowNull:false,
        get:Function,
        set:Function,
        validate:{[index:string]:any}
        }
}
礙你眼 回答
        function play()
        {
            index++;
            car.style.transition = 'transform 1s ease';
            car.style.transform = 'translateX(' + (-index * 600) + 'px)';
            car.addEventListener('transitionend', function()
            {
                //從邊界到邊界過渡以后切回正確位置
                if (index == 4)
                {
                    index = 1;
                    car.style.transition = 'none';
                    car.style.transform = 'translateX(' + (-index * 600) + 'px)';
                }
            })            
        }

邏輯還是有問題的。
前后各加一張圖的做法思路是從保證邊界圖片到邊界圖片(3->1或1->3)的切換效果不變,在切換后瞬間改變圖片位置到正確位置。
你的 index > 3 就錯(cuò)了,實(shí)現(xiàn)不了 3->1。
為了避免動(dòng)畫時(shí)間和計(jì)時(shí)器時(shí)間重疊,用了 transitionend 這個(gè)事件。

離觴 回答

好像不可以,用別的第三方插件解析一下json文件吧

陌南塵 回答
<!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">
    <style>
        .circle {
            width: 100px;
            height: 100px;
            border: 20px solid #000;
            border-radius: 50%;
            border-left-color: transparent;
            border-top-color: transparent;
            transform: rotate(-45deg);
        }
    </style>
</head>
<body>
<div class="circle"></div>
</body>
</html>

這個(gè)半圓用SVG寫的話也是挺簡(jiǎn)單的。

使用它提供的構(gòu)造器,一層一層的套,比較繁瑣;更簡(jiǎn)單直觀的就是jsx了

夕顏 回答

你這樣想
setTimeout(fn, 100)
fn是定義的一個(gè)函數(shù),它是隔了100毫秒才執(zhí)行
但是如果你寫成 setTimeout(fn(), 100) 這是函數(shù)自調(diào)用,fn函數(shù)會(huì)立即執(zhí)行,
隔了100毫秒,才會(huì)執(zhí)行fn return后的函數(shù)

葬憶 回答

沒有找到具體原因,但是我把cordova版本降低到6.5就好了,所以猜測(cè)是版本高的問題,如果有知道問題的大神請(qǐng)指教。

瘋浪 回答

/content/dam/sonystyle/products/color/([^\/]*)[$|/].*$

孤星 回答
server {
         listen 80 default_server;
         listen [::]:80 default_server;

         root < root-path or link >;
         index index.html;

         server_name < server-host >;

         location / {
                try_files $uri $uri/ /index.html =404;
                add_header cache-control max-age=86400;
         }
}

要用nginx伺服一個(gè)靜態(tài)頁面,就這么幾行配置就夠了。

一般linux建站比較簡(jiǎn)單的步驟是:

  • 先創(chuàng)建一個(gè)軟連接指向你的靜態(tài)資源目錄,比如/var/www/foo.com -> root-path,這樣你的配置文件中的root直接填軟鏈接就可以了,不用直接填資源地址
  • 之后在nginx的sites配置路徑下,新建一個(gè)配置文件,一般和你的域名對(duì)象,比如/etc/nginx/sites-available/foo.com,之后把上面的配置復(fù)制進(jìn)行,然后再創(chuàng)建一個(gè)軟鏈接指向/etc/nginx/sites-enabled/foo.com指向/etc/nginx/sites-available/foo.com
  • 然后用nginx校驗(yàn)一下,比如sudo nginx -t,配置文件有錯(cuò)誤會(huì)提示
  • 之后重啟服務(wù)器,sudo systemctl restart nginx

上面的命令不同的Linux系統(tǒng)略有不同,但是大同小異,多利用軟鏈接可以幫你省去重復(fù)修改配置文件的重復(fù)工作。

另外外網(wǎng)一般開放端口是80和443,8080的話需要指明端口。

如果這些整完還不行,嘗試檢查一下防火墻是否打開了你需要訪問的端口,命令sudo ufw status

風(fēng)畔 回答

先確認(rèn)一下 content-type 吧,response 的 content-type 是 json 么?看報(bào)錯(cuò)不太像,很像是返回了 text/html 的 header

別硬撐 回答

因?yàn)槟阆葎?chuàng)建的對(duì)象, 舊的原型鏈已經(jīng)建立好了.

        function Person(){}
        // var friend=new Person(); 注釋掉
        console.log(Person.prototype);            
        Person.prototype={                        
            constructor:Person,
            name:'ytf',
            age:'20',
            job:'student',
            sayName:function(){
                console.log(this.name);
            }
        }
        var friend=new Person(); // 在這里創(chuàng)建
        console.log(Person.prototype);
        console.log(friend.sayName());

這只取決于你服務(wù)端的響應(yīng)。在這頁面打開開發(fā)者工具,然后換成你這個(gè)segmentfault問題的url,你就看到和教程相似的結(jié)果。或者點(diǎn)開你有問題的頁面,點(diǎn)開Network,你也能明白為什么你只有content-type。