ホームページ ウェブフロントエンド jsチュートリアル jsデータ検証セット、js電子メール検証、js URL検証、js長さ検証、jsデジタル検証およびその他の単純なpackages_form効果

jsデータ検証セット、js電子メール検証、js URL検証、js長さ検証、jsデジタル検証およびその他の単純なpackages_form効果

May 16, 2016 pm 06:27 PM
js データ検証

以前、js データ検証、js メール検証、js URL 検証、js 長さ検証、js デジタル検証、その他のポップアップ ダイアログ ボックスを作成しましたが、そのような不親切な方法は今ではあまり普及していないので、書き直しました。 1 つ目は、カプセル化され、よりフレンドリーなレイヤー フォームが全員と共有されることです。使用中にバグがある場合は、改善するためにメッセージを残してください。


コードをコピー コードは次のとおりです:

/**
* データ検証フレームワーク。ID フィールドのチェックでエラーが発生した場合、エラー メッセージを表示するために、対応する応答の直後に
要素が追加されます。 >* @バージョン 2.1
* @説明 2009-05-16
*/
var checkData = new function() {
var idExt="_wangzi6hao_Span";//スパン層の ID サフィックスを生成します
/* *
* 中国語と英語の文字長を取得します (中国語は 2 文字です)
*
* @param {}
* str
* @return 文字の長さ
*/
this.length = function(str) {
var p1 = new RegExp('%u..', 'g')
var p2 = new RegExp('%. ', 'g')
returnscape(str).replace(p1, '').replace(p2, '').length
}
/**
* 対応する id 要素を削除
*/
これを削除 = function(id) {
var idObject = document.getElementById(id)
if (idObject != null)
idObject.parentNode.removeChild(idObject); >/ **
* 対応する id 以降のエラーメッセージ
*
* @param id: エラーメッセージを表示する必要がある id 要素
* str: エラーメッセージを表示
*/
this.appendError = function(id, str) {
this.remove(id idExt);//span 要素が存在する場合は、最初にこの要素を削除します
var spanNew = document.createElement("span"); // スパンを作成します
spanNew.id = id idExt; // spaid を生成します
spanNew.style.color = "red";
spanNew.appendChild; .createTextNode (str));// スパンにコンテンツを追加します
var inputId = document.getElementById(id);
inputId.parentNode.insertBefore(spanNew, inputId.nextSibling);// スパンを追加します
}
/**
* @description すべてのスペース文字をフィルターします。
* @param str: スペースを削除する必要がある元の文字列
* @return スペースを削除した文字列を返します
*/
this.trimSpace = function(str) {
str = "";
while ((str.charAt(0) == ' ') || (str.charAt(0) == '???')
|| (escape(str.charAt(0) )) == '%u3000'))
str = str.substring(1, str.length);
while ((str.charAt(str.length - 1) == ' ')
|| (str.charAt(str.length - 1) == '???')
|| (escape(str.charAt(str.length - 1)) == '%u3000'))
str = str.substring(0, str.length - 1);
return str;
/**
* 文字列の先頭のスペースと文字列の末尾のスペースをフィルタリングします。テキストの途中にある複数の連続したスペースを 1 つのスペースに変更します。
*
* @param {Object}
* inputString
*/
this.trim = function(inputString) {
if (typeof inputString != "string") {
return inputString;
var retValue = inputString;
while (ch == " ") {
// 文字列の先頭のスペースを確認します
retValue = retValue.substring(1, retValue.length);
ch = retValue.substring(0, 1); );
}
ch = retValue.substring(retValue.length - 1, retValue.length);
while (ch == " ") {
// の末尾のスペースを確認します文字列
retValue = retValue.substring(0, retValue.length - 1);
ch = retValue.substring(retValue.length - 1, retValue.length);
}
while (retValue) .indexOf(" ") != -1) {
// テキストの途中にある複数の連続したスペースを 1 つのスペースに変更します
retValue = retValue.substring(0, retValue.indexOf(" "))
retValue.substring (retValue.indexOf(" ") 1,
retValue.length);
return
}
/**
* フィルター文字列。フィルターの内容を指定します。内容が空の場合、デフォルトのフィルターは '~!@#$%^&*()- です。"
*
* @param {Object}
* str
* @param {Object}
* filterStr
*
* @return にはフィルターの内容が含まれており、True を返します。それ以外の場合は false を返します。*/
this.filterStr = function(str, filterString) {
filterString = filterString == "" ? "'~!@#$%^&*()- ."" : filterString
var ch;
var i;
var temp;
var error = false;// 不正な文字が含まれる場合、True
for (i = 0; i ch = filterString.charAt(i);
temp = str.indexOf(ch);
if (temp != -1) {
error = true;
}
}
エラーを返します;
}
this.filterStrSpan = function(id, filterString) {
filterString = filterString == "" "'~!@#$ %^&*( )- ."" : filterString
var val = document.getElementById(id);
if (this.filterStr(val.value, filterString)) {
val.select() ;
var str = "不正な文字を含めることはできません" filterString;
this.appendError(id, str);
} else {
this.remove(id idExt);
return true ;
}
}
/**
* URL であるかどうかを確認します
*
* @param {}
* str_url
* @return {Boolean} true: URL です、false:
ではありません
URL*/
this.isURL = function(str_url) {// 検証 URL
var strRegex = "^( (https|http|ftp|rtsp|mms)?://)"
"?(([0-9a-z_!~*'().&= $%-] : )?[0-9a -z_!~* '().&= $%-] @)?" // ftp user@
"(([0-9]{1,3}.){3}[0-9] {1,3 }" // IP 形式の URL - 199.194.52.184
"|" // IP と DOMAIN (ドメイン名) を許可
"([0-9a-z_!~*'()- ] .)*" // ドメイン名 - www.
"([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]." //第 2 レベルのドメイン名
"[a-z]{2,6})" // 第 1 レベルのドメイン - .com または .museum
"(:[0-9]{1,4})?" / / Port- :80
"((/?)|" // ファイル名がない場合はスラッシュは必要ありません
"(/[0-9a-z_!~*'().; ?:@&= $,% #-] ) /?)$";
var re = new RegExp(strRegex);
return re.test(str_url);
}
これ。 isURLSpan = function(id) {
var val = document.getElementById(id);
if (!this.isURL(val.value)) {
val.select(); = "リンクが形式に準拠していません;" ;
this.appendError(id, str);
this.remove(id idExt); true を返す;
}
}
/**
* メールかどうかを確認します
*
* @param {}
* str
* @return {Boolean} true: email、false: ではありませんメール
*/
this.isEmail = function(str) {
var re = /^([a-zA-Z0- 9] [_|-|.]?) *[a-zA-Z0-9] @([a-zA-Z0-9] [_|-|.]?)*[a-zA-Z0-9 ] .[a-zA-Z]{2 ,3}$/;
return re.test(str)
}
this.isEmailSpan = function(id) {
var val = document.getElementById(id);
if (!this.isEmail(val.value)) {
val.select();
var str = "メールが形式を満たしていません;"; >this.appendError(id, str);
return false;
} else {
this.remove(id idExt);
を返します。 /**
* 数値かどうかを確認します
*
* @param {}
* str
* @return {Boolean} true: 数値、false: ではありません。 /b> 番号;*/
this.isNum = function(str) {
var re = /^[d] $/
return re.test(str);
this.isNumSpan = function(id) {
var val = document.getElementById(id);
if (!this.isNum(val.value)) {
val.select();
var str = "数値でなければなりません;";
this.appendError(id, str);
} else {
this.remove(id idExt); 🎜 >return true;
}
}
/**
* 値が指定された範囲内にあるかどうかをチェックします。値が空の場合はチェックは実行されません

*
* @param {}
* str_num
* @param { }
* small 以上である必要がある値 (この値が空の場合は、最大値を超えてはいけないことだけを確認してください)
* @param {}
* big 値以下である必要があります (この値が空の場合、チェックは最小値未満にすることはできません)
*
* @return {Boolean} 最小値未満またはそれ以上最大値よりも数値が大きい場合は false を返し、それ以外の場合は true を返します。*/
this.isRangeNum = function(str_num, small, big) {
if (!this.isNum( str_num )) // 数値かどうかを確認します
return false
if (small == "" && big == "")
throw str_num "最大値または最小値は定義されていません。";
if (small != "") {
if (str_num < small)
return false;
}
if (big != "") {
if (str_num > big)
return false;
}
return true;
}
this.isRangeNumSpan = function(id, small, big) {
var val = document. getElementById(id);
if (!this.isRangeNum(val.value, small, big)) {
val.select();
var str = ""; = "") {
str = "以下である必要があります" small
}
if (big != "") {
str = "以下である必要があります; " big;
}
this.appendError(id, str);
return false;
} else {
this.remove(id idExt);
return true;
}
}
/**
* 修飾された文字列であるかどうかを確認します (大文字と小文字は区別されません)

* は a-z0-9_
*
* @param {}
* str チェックされた文字列
* @param {}
* idStr カーソル位置のフィールド ID
* @return {Boolean} No 「a-z0-9_」構成は false を返し、それ以外の場合は true を返します。*/
this.isLicit = function(str) {
var re = /^[_0-9a-zA-Z]*$/
return re.test (str);
}
this.isLicitSpan = function(id) {
var val = document.getElementById(id)
if (!this.isLicit(val) .value)) {
val.select();
var str = "a-z0-9_ で構成される文字列です (大文字と小文字は区別されません);"; );
return false;
} else {
this.remove(id idExt);
}
/**
* 2 つの文字列が等しいかどうかを確認します
*
* @param {}
* str1 最初の文字列
* @param {}
* str2 2 番目の文字列
* @ return {Boolean} 文字列が等しくない場合は false を返し、それ以外の場合は true を返します。*/
this .isEquals = function(str1, str2) {
return str1 == str2;
}
this.isEqualsSpan = function(id, id1) {
var val = document.getElementById (id);
var val1 = document.getElementById(id1);
if (!this.isEquals(val.value, val1.value)) {
val.select(); str = "二入力内容は同じである必要があります;";
this.appendError(id, str);
return false;
this.remove(id idExt); 🎜>return true;
}
}
/**
* 文字列が指定された長さの範囲内にあるかどうかをチェックします (漢字は 2 バイトとして計算されます)。文字が空の場合はチェックは実行されません。
*
* @param {}
* str チェックされた文字
* @param {}
*lessLen 以上である必要がある長さ
* @param {}
* moreLen 以下である必要がある長さ
*
* @return {Boolean} 最小長より小さい、または最大長より大きい数値は false を返します。*/
this.isRange = function(str, lessLen, moreLen) {
var strLen = this.length( str);
if (lessLen != "") {
if (strLen return false;
}
if (moreLen != "") {
if (strLen > moreLen )
return false;
}
if (lessLen == "" && moreLen == "")
throw "最大長と最小長が定義されていません!"; > true を返す;
}
this.isRangeSpan = function(id,lessLen, moreLen) {
var val = document.getElementById(id);
if (!this.isRange(val.value) 、lessLen、moreLen)) {
var str = "長さ";
if (lessLen != "")
str = "「lessLen」以上;"; moreLen != "")
str = "以下である必要があります" moreLen;
this.appendError(id, str); 🎜>} else {
this.remove( id idExt);
return true;
}
}
/**
* 文字列が指定された長さの範囲より小さいかどうかを確認します (漢字は 2 バイトとして計算されます)

*
* @param {}
* str string
* @param {}
* 長さ以下のlessLen
*
* @return {Boolean} 指定された長さの数値より小さい場合は false を返します。*/
this.isLess = function( str,lessLen) {
return this.isRange (str,lessLen, "");
}
this.isLessSpan = function(id,lessLen) {
var val = document.getElementById(id) );
if (!this.isLess( val.value,lessLen)) {
var str = "長さはlessLen以上です"
val.select(); .appendError(id, str);
return
} else {
this.remove(id idExt);
return
}
/* *
* 文字列が指定された長さの範囲より大きいかどうかを確認します (漢字は 2 バイトとして計算されます)

*
* @param {}
* str string
* @param {}
* 長さ以下の moreLen
*
* @return {Boolean} 指定された長さの数値より大きい場合
を返します。*/
this.isMore = function( str, moreLen) {
return this.isRange(str, "", moreLen);
}
this.isMoreSpan = function(id) , moreLen) {
var val = document.getElementById(id );
if (!this.isMore(val.value, moreLen)) {
var str = "長さは以下でなければなりません" moreLen;
val.select();
this.appendError (id, str);
return false;
} else {
this.remove(id idExt);
return true;
}
}
/**
* 文字が空でないことを確認します
*
* @param {}
* str
* @ {ブール値}を返す文字が空です true を返します。それ以外の場合は false;
*/
this.isEmpty = function(str) {
return str == ""; >this.isEmptySpan = function(id) {
var val = document.getElementById(id);
if (this.isEmpty(val.value)) {
var str = "空は許可されません。" ;
val.select();
this.appendError(id, str);
return false;
this.remove(id idExt); ;
}
}
}


テストページ



コードをコピー
コードは次のとおりです。 Web ページのタイトル </div><script type="text / javascript" src="test.js"></script> <div class="codebody" id="code38730"><script type="text/javascript"> <br>function checkForm(){ <br>var isPass = true; <br> // フィルター文字列<br>if(!(checkData.isEmptySpan("filterStr") && checkData.filterStrSpan('filterStr','#$%$'))) { <br>isPass = false; 🎜>//URL をチェック <br>if(!(checkData.isEmptySpan("isURL") && checkData.isURLSpan('isURL'))) <br>isPass = false <br>//メール <br> if( !(checkData.isEmptySpan("isEmail") && checkData.isEmailSpan('isEmail'))) <br>isPass = false; <br>//Number<br>if(!(checkData.isNumSpan('isNum' )) ) <br>isPass = false; <br>//数値サイズ<br>if(!(checkData.isEmptySpan("isRangeNum") && checkData.isNumSpan('isRangeNum') && checkData.isRangeNumSpan('isRangeNum', 10,100) )) <br>isPass = false; <br>//パスワード (数字、文字、アンダースコア) <br>if(!(checkData.isLicitSpan('isLicit'))) <br>isPass = false; // 2 つのフィールドが等しいかどうか<br>if(!(checkData.isEquals") && checkData.isEqualsSpan('isEquals','isEquals1'))) <br>isPass = false;文字長制御<br>if(!(checkData.isRangeSpan('isRange',5,10))) <br>isPass = false; <br>//最短文字制御<br>if(!(checkData.isLessSpan( 'isLess',10))) <br>isPass = false; <br>//最大文字制御<br>if(!(checkData.isEmptySpan("isMore") && checkData.isMoreSpan('isMore',30) ) ) <br>isPass = false; <br>//空のコントロール<br>if(!(checkData.isEmpty")) <br>isPass = false; 🎜></script> <br></head> <br><body> <br><form action="index.jsp" method="post" onsubmit="return checkForm();" ; <BR><table> <br><tr> <br><td> 文字フィルタリング: <input type="text" id="filterStr" name="filterStr" ></td> <br><td>リンク:<input type="text" id="isURL" name="isURL"><br></tr> 🎜><tr> <br><td>メール: <input type="text" id="isEmail" name="isEmail"><br><td>番号 :< ;input type="text" id="isNum" name="isNum"><br></tr> <br><td> 数値範囲:< ;input type="text" id="isRangeNum" name="isRangeNum"></td> <br><td>a-zA-Z0-9_<input type="text" id="isLicit" name="isLicit"></td> <br><tr> <br><td> 等しいかどうかを判断します: <input type="text" id=" isEquals" name="isEquals"></td> <br><td><input type="text" id="isEquals1" name="isEquals1"></td> tr> <br><tr> <br><td>長さコントロール: <input type="text" id="isRange" name="isRange"><br><td> ;長さがコントロールより大きい:<input type="text" id="isLess" name="isLess"></td> <br><tr> ;td>長さがコントロールより小さいです: <input type="text" id="isMore" name="isMore"></td> <br><td> 空ですか: <input type= " text" id="isEmpty" name="isEmpty"><br></tr> <br><td><input type="submit" name ="submit" value="データを送信"><br></tr> <br></table> <br></body><br></html></div> </div> </div> </div> <div class="wzconShengming_sp"> <div class="bzsmdiv_sp">このウェブサイトの声明</div> <div>この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。</div> </div> </div> <ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5902227090019525" data-ad-slot="2507867629"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <div class="AI_ToolDetails_main4sR"> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5902227090019525" data-ad-slot="3653428331" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <!-- <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>人気の記事</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796780570.html" title="R.E.P.O.説明されたエネルギー結晶と彼らが何をするか(黄色のクリスタル)" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.説明されたエネルギー結晶と彼らが何をするか(黄色のクリスタル)</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>1 か月前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796780641.html" title="R.E.P.O.最高のグラフィック設定" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.最高のグラフィック設定</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>1 か月前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796785841.html" title="アサシンのクリードシャドウズ:シーシェルリドルソリューション" class="phpgenera_Details_mainR4_bottom_title">アサシンのクリードシャドウズ:シーシェルリドルソリューション</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796789525.html" title="Windows11 KB5054979の新しいものと更新の問題を修正する方法" class="phpgenera_Details_mainR4_bottom_title">Windows11 KB5054979の新しいものと更新の問題を修正する方法</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>2週間前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796780618.html" title="Will R.E.P.O.クロスプレイがありますか?" class="phpgenera_Details_mainR4_bottom_title">Will R.E.P.O.クロスプレイがありますか?</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>1 か月前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/article.html">もっと見る</a> </div> </div> </div> --> <div class="phpgenera_Details_mainR3"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hottools2.png" alt="" /> <h2>ホットAIツール</h2> </div> <div class="phpgenera_Details_mainR3_bottom"> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411540686492.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undresser.AI Undress" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_title"> <h3>Undresser.AI Undress</h3> </a> <p>リアルなヌード写真を作成する AI 搭載アプリ</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411552797167.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Clothes Remover" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_title"> <h3>AI Clothes Remover</h3> </a> <p>写真から衣服を削除するオンライン AI ツール。</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173410641626608.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undress AI Tool" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_title"> <h3>Undress AI Tool</h3> </a> <p>脱衣画像を無料で</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411529149311.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Clothoff.io" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_title"> <h3>Clothoff.io</h3> </a> <p>AI衣類リムーバー</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/ai-hentai-generator" title="AI Hentai Generator" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173405034393877.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Hentai Generator" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/ai-hentai-generator" title="AI Hentai Generator" class="phpmain_tab2_mids_title"> <h3>AI Hentai Generator</h3> </a> <p>AIヘンタイを無料で生成します。</p> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/ai">もっと見る</a> </div> </div> </div> <script src="https://sw.php.cn/hezuo/cac1399ab368127f9b113b14eb3316d0.js" type="text/javascript"></script> <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>人気の記事</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796780570.html" title="R.E.P.O.説明されたエネルギー結晶と彼らが何をするか(黄色のクリスタル)" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.説明されたエネルギー結晶と彼らが何をするか(黄色のクリスタル)</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>1 か月前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796780641.html" title="R.E.P.O.最高のグラフィック設定" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.最高のグラフィック設定</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>1 か月前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796785841.html" title="アサシンのクリードシャドウズ:シーシェルリドルソリューション" class="phpgenera_Details_mainR4_bottom_title">アサシンのクリードシャドウズ:シーシェルリドルソリューション</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796789525.html" title="Windows11 KB5054979の新しいものと更新の問題を修正する方法" class="phpgenera_Details_mainR4_bottom_title">Windows11 KB5054979の新しいものと更新の問題を修正する方法</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>2週間前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796780618.html" title="Will R.E.P.O.クロスプレイがありますか?" class="phpgenera_Details_mainR4_bottom_title">Will R.E.P.O.クロスプレイがありますか?</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>1 か月前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/article.html">もっと見る</a> </div> </div> </div> <div class="phpgenera_Details_mainR3"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hottools2.png" alt="" /> <h2>ホットツール</h2> </div> <div class="phpgenera_Details_mainR3_bottom"> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/92" title="メモ帳++7.3.1" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab96f0f39f7357.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="メモ帳++7.3.1" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/92" title="メモ帳++7.3.1" class="phpmain_tab2_mids_title"> <h3>メモ帳++7.3.1</h3> </a> <p>使いやすく無料のコードエディター</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/93" title="SublimeText3 中国語版" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97a3baad9677.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 中国語版" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/93" title="SublimeText3 中国語版" class="phpmain_tab2_mids_title"> <h3>SublimeText3 中国語版</h3> </a> <p>中国語版、とても使いやすい</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/121" title="ゼンドスタジオ 13.0.1" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97ecd1ab2670.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="ゼンドスタジオ 13.0.1" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/121" title="ゼンドスタジオ 13.0.1" class="phpmain_tab2_mids_title"> <h3>ゼンドスタジオ 13.0.1</h3> </a> <p>強力な PHP 統合開発環境</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/469" title="ドリームウィーバー CS6" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d0e0fc74683535.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="ドリームウィーバー CS6" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/469" title="ドリームウィーバー CS6" class="phpmain_tab2_mids_title"> <h3>ドリームウィーバー CS6</h3> </a> <p>ビジュアル Web 開発ツール</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/500" title="SublimeText3 Mac版" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d34035e2757995.png?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 Mac版" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/500" title="SublimeText3 Mac版" class="phpmain_tab2_mids_title"> <h3>SublimeText3 Mac版</h3> </a> <p>神レベルのコード編集ソフト(SublimeText3)</p> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/ai">もっと見る</a> </div> </div> </div> <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>ホットトピック</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/gmailyxdlrkzn" title="Gmailメールのログイン入り口はどこですか?" class="phpgenera_Details_mainR4_bottom_title">Gmailメールのログイン入り口はどこですか?</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>7554</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>15</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/cakephp-tutor" title="CakePHP チュートリアル" class="phpgenera_Details_mainR4_bottom_title">CakePHP チュートリアル</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>1382</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>52</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/steamdzhmcssmgs" title="Steamのアカウント名の形式は何ですか" class="phpgenera_Details_mainR4_bottom_title">Steamのアカウント名の形式は何ですか</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>83</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>11</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/winactivationkeyper" title="Win11 Activation Key Permanent" class="phpgenera_Details_mainR4_bottom_title">Win11 Activation Key Permanent</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>59</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>19</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/newyorktimesdailybrief" title="NYTの接続はヒントと回答です" class="phpgenera_Details_mainR4_bottom_title">NYTの接続はヒントと回答です</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>25</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>96</span> </div> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/faq/zt">もっと見る</a> </div> </div> </div> </div> </div> <div class="Article_Details_main2"> <div class="phpgenera_Details_mainL4"> <div class="phpmain1_2_top"> <a href="javascript:void(0);" class="phpmain1_2_top_title">Related knowledge<img src="/static/imghw/index2_title2.png" alt="" /></a> </div> <div class="phpgenera_Details_mainL4_info"> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/629494.html" title="JS と Baidu Maps を使用してマップ パン機能を実装する方法" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/000/164/170053204074362.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="JS と Baidu Maps を使用してマップ パン機能を実装する方法" /> </a> <a href="https://www.php.cn/ja/faq/629494.html" title="JS と Baidu Maps を使用してマップ パン機能を実装する方法" class="phphistorical_Version2_mids_title">JS と Baidu Maps を使用してマップ パン機能を実装する方法</a> <span class="Articlelist_txts_time">Nov 21, 2023 am 10:00 AM</span> <p class="Articlelist_txts_p">JS と Baidu Map を使用してマップ パン機能を実装する方法 Baidu Map は広く使用されている地図サービス プラットフォームで、Web 開発で地理情報、位置情報、その他の機能を表示するためによく使用されます。この記事では、JS と Baidu Map API を使用してマップ パン機能を実装する方法と、具体的なコード例を紹介します。 1. 準備 Baidu Map API を使用する前に、Baidu Map Open Platform (http://lbsyun.baidu.com/) で開発者アカウントを申請し、アプリケーションを作成する必要があります。作成完了</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/734386.html" title="推奨: 優れた JS オープンソースの顔検出および認識プロジェクト" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/887/227/171211651392093.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="推奨: 優れた JS オープンソースの顔検出および認識プロジェクト" /> </a> <a href="https://www.php.cn/ja/faq/734386.html" title="推奨: 優れた JS オープンソースの顔検出および認識プロジェクト" class="phphistorical_Version2_mids_title">推奨: 優れた JS オープンソースの顔検出および認識プロジェクト</a> <span class="Articlelist_txts_time">Apr 03, 2024 am 11:55 AM</span> <p class="Articlelist_txts_p">顔の検出および認識テクノロジーは、すでに比較的成熟しており、広く使用されているテクノロジーです。現在、最も広く使用されているインターネット アプリケーション言語は JS ですが、Web フロントエンドでの顔検出と認識の実装には、バックエンドの顔認識と比較して利点と欠点があります。利点としては、ネットワーク インタラクションの削減とリアルタイム認識により、ユーザーの待ち時間が大幅に短縮され、ユーザー エクスペリエンスが向上することが挙げられます。欠点としては、モデル サイズによって制限されるため、精度も制限されることが挙げられます。 js を使用して Web 上に顔検出を実装するにはどうすればよいですか? Web 上で顔認識を実装するには、JavaScript、HTML、CSS、WebRTC など、関連するプログラミング言語とテクノロジに精通している必要があります。同時に、関連するコンピューター ビジョンと人工知能テクノロジーを習得する必要もあります。 Web 側の設計により、次の点に注意してください。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/633499.html" title="株価分析に必須のツール: PHP と JS を使用してローソク足チャートを描画する手順を学びます" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/465/014/170281051584846.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="株価分析に必須のツール: PHP と JS を使用してローソク足チャートを描画する手順を学びます" /> </a> <a href="https://www.php.cn/ja/faq/633499.html" title="株価分析に必須のツール: PHP と JS を使用してローソク足チャートを描画する手順を学びます" class="phphistorical_Version2_mids_title">株価分析に必須のツール: PHP と JS を使用してローソク足チャートを描画する手順を学びます</a> <span class="Articlelist_txts_time">Dec 17, 2023 pm 06:55 PM</span> <p class="Articlelist_txts_p">株式分析に必須のツール: PHP および JS でローソク足チャートを描画する手順を学びます。特定のコード例が必要です。インターネットとテクノロジーの急速な発展に伴い、株式取引は多くの投資家にとって重要な方法の 1 つになりました。株価分析は投資家の意思決定の重要な部分であり、ローソク足チャートはテクニカル分析で広く使用されています。 PHP と JS を使用してローソク足チャートを描画する方法を学ぶと、投資家がより適切な意思決定を行うのに役立つ、より直感的な情報が得られます。ローソク足チャートとは、株価をローソク足の形で表示するテクニカルチャートです。株価を示しています</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/633266.html" title="PHP と JS を使用して株価ローソク足チャートを作成する方法" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/887/227/170277173527364.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="PHP と JS を使用して株価ローソク足チャートを作成する方法" /> </a> <a href="https://www.php.cn/ja/faq/633266.html" title="PHP と JS を使用して株価ローソク足チャートを作成する方法" class="phphistorical_Version2_mids_title">PHP と JS を使用して株価ローソク足チャートを作成する方法</a> <span class="Articlelist_txts_time">Dec 17, 2023 am 08:08 AM</span> <p class="Articlelist_txts_p">PHP と JS を使用して株のローソク足チャートを作成する方法。株のローソク足チャートは、株式市場で一般的なテクニカル分析グラフィックです。始値、終値、最高値、株価などのデータを描画することで、投資家が株式をより直観的に理解するのに役立ちます。株価の最低価格、価格変動。この記事では、PHP と JS を使用して株価のローソク足チャートを作成する方法を、具体的なコード例とともに説明します。 1. 準備 開始する前に、次の環境を準備する必要があります。 1. PHP を実行するサーバー 2. HTML5 および Canvas をサポートするブラウザー 3</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/629475.html" title="JSとBaidu Mapsを使ってマップヒートマップ機能を実装する方法" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/887/227/170053040496360.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="JSとBaidu Mapsを使ってマップヒートマップ機能を実装する方法" /> </a> <a href="https://www.php.cn/ja/faq/629475.html" title="JSとBaidu Mapsを使ってマップヒートマップ機能を実装する方法" class="phphistorical_Version2_mids_title">JSとBaidu Mapsを使ってマップヒートマップ機能を実装する方法</a> <span class="Articlelist_txts_time">Nov 21, 2023 am 09:33 AM</span> <p class="Articlelist_txts_p">JS と Baidu Maps を使用してマップ ヒート マップ機能を実装する方法 はじめに: インターネットとモバイル デバイスの急速な発展に伴い、マップは一般的なアプリケーション シナリオになりました。視覚的な表示方法として、ヒート マップはデータの分布をより直観的に理解するのに役立ちます。この記事では、JS と Baidu Map API を使用してマップ ヒート マップ機能を実装する方法と、具体的なコード例を紹介します。準備作業: 開始する前に、次の項目を準備する必要があります: Baidu 開発者アカウント、アプリケーションの作成、対応する AP の取得</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/629525.html" title="JSと百度地図を使って地図クリックイベント処理機能を実装する方法" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/000/164/170053627491331.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="JSと百度地図を使って地図クリックイベント処理機能を実装する方法" /> </a> <a href="https://www.php.cn/ja/faq/629525.html" title="JSと百度地図を使って地図クリックイベント処理機能を実装する方法" class="phphistorical_Version2_mids_title">JSと百度地図を使って地図クリックイベント処理機能を実装する方法</a> <span class="Articlelist_txts_time">Nov 21, 2023 am 11:11 AM</span> <p class="Articlelist_txts_p">JS と Baidu Maps を使用してマップ クリック イベント処理を実装する方法の概要: Web 開発では、地理的位置と地理情報を表示するためにマップ関数を使用することが必要になることがよくあります。マップ上のクリック イベント処理は、マップ機能の一般的に使用される重要な部分です。この記事では、JS と Baidu Map API を使用して地図のクリック イベント処理機能を実装する方法と、具体的なコード例を紹介します。手順: Baidu Map の API ファイルをインポートします。まず、Baidu Map API のファイルを HTML ファイルにインポートします。これは、次のコードによって実現できます。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/633755.html" title="PHP および JS 開発のヒント: 株価ローソク足チャートの描画方法をマスターする" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/887/227/170288520192764.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="PHP および JS 開発のヒント: 株価ローソク足チャートの描画方法をマスターする" /> </a> <a href="https://www.php.cn/ja/faq/633755.html" title="PHP および JS 開発のヒント: 株価ローソク足チャートの描画方法をマスターする" class="phphistorical_Version2_mids_title">PHP および JS 開発のヒント: 株価ローソク足チャートの描画方法をマスターする</a> <span class="Articlelist_txts_time">Dec 18, 2023 pm 03:39 PM</span> <p class="Articlelist_txts_p">インターネット金融の急速な発展に伴い、株式投資を選択する人がますます増えています。株式取引では、ローソク足チャートは一般的に使用されるテクニカル分析手法であり、株価の変化傾向を示し、投資家がより正確な意思決定を行うのに役立ちます。この記事では、PHP と JS の開発スキルを紹介し、株価ローソク足チャートの描画方法を読者に理解してもらい、具体的なコード例を示します。 1. 株のローソク足チャートを理解する 株のローソク足チャートの描き方を紹介する前に、まずローソク足チャートとは何かを理解する必要があります。ローソク足チャートは日本人が開発した</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/629514.html" title="JSとBaidu Mapsを使って地図ポリゴン描画機能を実装する方法" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/465/014/170053520228035.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="JSとBaidu Mapsを使って地図ポリゴン描画機能を実装する方法" /> </a> <a href="https://www.php.cn/ja/faq/629514.html" title="JSとBaidu Mapsを使って地図ポリゴン描画機能を実装する方法" class="phphistorical_Version2_mids_title">JSとBaidu Mapsを使って地図ポリゴン描画機能を実装する方法</a> <span class="Articlelist_txts_time">Nov 21, 2023 am 10:53 AM</span> <p class="Articlelist_txts_p">JS と Baidu Maps を使用して地図ポリゴン描画機能を実装する方法 現代の Web 開発において、地図アプリケーションは一般的な機能の 1 つになっています。地図上にポリゴンを描画すると、ユーザーが表示および分析できるように特定のエリアをマークするのに役立ちます。この記事では、JS と Baidu Map API を使用して地図ポリゴン描画機能を実装する方法と、具体的なコード例を紹介します。まず、Baidu Map API を導入する必要があります。次のコードを使用して、Baidu Map API の JavaScript を HTML ファイルにインポートできます。</p> </div> </div> <a href="https://www.php.cn/ja/web-designer.html" class="phpgenera_Details_mainL4_botton"> <span>See all articles</span> <img src="/static/imghw/down_right.png" alt="" /> </a> </div> </div> </div> </main> <footer> <div class="footer"> <div class="footertop"> <img src="/static/imghw/logo.png" alt=""> <p>福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!</p> </div> <div class="footermid"> <a href="https://www.php.cn/ja/about/us.html">私たちについて</a> <a href="https://www.php.cn/ja/about/disclaimer.html">免責事項</a> <a href="https://www.php.cn/ja/update/article_0_1.html">Sitemap</a> </div> <div class="footerbottom"> <p> © php.cn All rights reserved </p> </div> </div> </footer> <input type="hidden" id="verifycode" value="/captcha.html"> <script>layui.use(['element', 'carousel'], function () {var element = layui.element;$ = layui.jquery;var carousel = layui.carousel;carousel.render({elem: '#test1', width: '100%', height: '330px', arrow: 'always'});$.getScript('/static/js/jquery.lazyload.min.js', function () {$("img").lazyload({placeholder: "/static/images/load.jpg", effect: "fadeIn", threshold: 200, skip_invisible: false});});});</script> <script src="/static/js/common_new.js"></script> <script type="text/javascript" src="/static/js/jquery.cookie.js?1744958981"></script> <script src="https://vdse.bdstatic.com//search-video.v1.min.js"></script> <link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css?2' type='text/css' media='all' /> <script type='text/javascript' src='/static/js/viewer.min.js?1'></script> <script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script> <script type="text/javascript" src="/static/js/global.min.js?5.5.53"></script> <script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function () { var u = "https://tongji.php.cn/"; _paq.push(['setTrackerUrl', u + 'matomo.php']); _paq.push(['setSiteId', '9']); var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0]; g.async = true; g.src = u + 'matomo.js'; s.parentNode.insertBefore(g, s); })(); </script> <script> // top layui.use(function () { var util = layui.util; util.fixbar({ on: { mouseenter: function (type) { layer.tips(type, this, { tips: 4, fixed: true, }); }, mouseleave: function (type) { layer.closeAll("tips"); }, }, }); }); document.addEventListener("DOMContentLoaded", (event) => { // 定义一个函数来处理滚动链接的点击事件 function setupScrollLink(scrollLinkId, targetElementId) { const scrollLink = document.getElementById(scrollLinkId); const targetElement = document.getElementById(targetElementId); if (scrollLink && targetElement) { scrollLink.addEventListener("click", (e) => { e.preventDefault(); // 阻止默认链接行为 targetElement.scrollIntoView({ behavior: "smooth" }); // 平滑滚动到目标元素 }); } else { console.warn( `Either scroll link with ID '${scrollLinkId}' or target element with ID '${targetElementId}' not found.` ); } } // 使用该函数设置多个滚动链接 setupScrollLink("Article_Details_main1L2s_1", "article_main_title1"); setupScrollLink("Article_Details_main1L2s_2", "article_main_title2"); setupScrollLink("Article_Details_main1L2s_3", "article_main_title3"); setupScrollLink("Article_Details_main1L2s_4", "article_main_title4"); setupScrollLink("Article_Details_main1L2s_5", "article_main_title5"); setupScrollLink("Article_Details_main1L2s_6", "article_main_title6"); // 可以继续添加更多的滚动链接设置 }); window.addEventListener("scroll", function () { var fixedElement = document.getElementById("Article_Details_main1Lmain"); var scrollTop = window.scrollY || document.documentElement.scrollTop; // 兼容不同浏览器 var clientHeight = window.innerHeight || document.documentElement.clientHeight; // 视口高度 var scrollHeight = document.documentElement.scrollHeight; // 页面总高度 // 计算距离底部的距离 var distanceToBottom = scrollHeight - scrollTop - clientHeight; // 当距离底部小于或等于300px时,取消固定定位 if (distanceToBottom <= 980) { fixedElement.classList.remove("Article_Details_main1Lmain"); fixedElement.classList.add("Article_Details_main1Lmain_relative"); } else { // 否则,保持固定定位 fixedElement.classList.remove("Article_Details_main1Lmain_relative"); fixedElement.classList.add("Article_Details_main1Lmain"); } }); </script> </body> </html>