国产xxxx99真实实拍_久久不雅视频_高清韩国a级特黄毛片_嗯老师别我我受不了了小说

資訊專欄INFORMATION COLUMN

[叁]Flask web開發:模板

mochixuan / 1640人閱讀

摘要:使用真實值替代變量,再返回最終得到的響應字符串,這一過程成為渲染。渲染模板渲染模板提供的函數把模板引擎集成到了程序中。隨后的參數都是鍵值對,表示模板中變量對應的真實值。程序現在使用的模板繼承自不是直接繼承自的基模板。

本系列筆記是我閱讀Miguel Grinberg的《Flask Web Development》的筆記,標題與書本同步。希望通過記錄技術筆記的方式促進自己對知識的理解。

本篇對應書本第三章:模板。

模板是一個包含響應文本的文件,其中包含用占位變量表示的動態部分,其具體值只在請求的上下文中才能知道。使用真實值替代變量,再返回最終得到的響應字符串,這一過程成為渲染。

Jinja2模板引擎

Flask渲染模板使用的是Jinja2模板引擎。

渲染模板
hello.py 渲染模板
from flask import Flask,render_template

#...

@app.route("/")
def index():
    return render_template("index.html")

@app.route("/user/")
def user(name):
    return render_template("user.html",name=name)
    
# Flask提供的render_template函數把Jinja2模板引擎集成到了程序中。
# render_template函數的第一個參數是模板的文件名。
# 隨后的參數都是鍵值對,表示模板中變量對應的真實值。
變量

模板中使用的{{ name }}結構表示一個變量,它是一種特殊的占位符,告訴模塊引擎這個位置的值從渲染模板時使用的數據中獲取。

Jinja2能識別所有類型的變量,示例:

A value from a dictionary:{{ mydict["key"]}}.

A value from a list:{{ mylist[3]}}.

A value from a list,with a variable index:{{ mylist[myintvar] }}.

A value from an object"s method: {{ myobj.somemethod() }}.

變量過濾器

過濾器名添加在變量之后,中間使用豎線分隔。

hello, {{ name|capitalize }}

常用過濾器:

過濾器名 說明
safe 渲染值時不轉義
capitalize 把值得首字母轉換成大寫,其他字母轉換成小寫
lower 把值轉換成小寫形式
upper 把值轉換成大寫形式
title 把值中每個單詞的首字母都換成大寫
trim 把值的首位空格去掉
striptags 渲染之前把值中所有的HTML標簽都刪掉
控制結構 條件控制結構
{% if user %}
    Hello,{{ user }}!
{% else %}
    Hello, Stranger!
{% endif %}
渲染一組元素
    {% for comment in comments %}
  • {{ comment }}
  • {% endfor %}
{{% macro render_comment(comment)%}}
    
  • {{ comment }}
  • {{ endmacro }}
      {% for comment in comments %} {{ render_comment(comment) }} {% endfor %}
    為了重復使用宏,保存在多帶帶文件中,再在需要的模板中導入。 {% import "macro.html" as macros %}
      {% for comment in comments%} {{ macros.render_comment(comment)}} {% endfor%}
    復用代碼片段
    {% include "common.html" %}
    
    模板繼承
    - 建一個名為base.html的基模板
    
    
        {% block head %}
        {% block title %}{% endblock %} - My Application
        {% endblock %}
    
    
        {% block body %}
        {% endblock %}
    
    
    
    - 衍生模板中修改block標簽定義的元素
    {% extends "base.html" %} #定義基模板
    {% block title%}Index{% endblock %} #修改title塊內容
    {% block head %} #修改head塊內容
        {{ super() }} #原來head中有內容,用super()獲取原來的內容
        
    {% endblock %}
    {% block body %} #修改body塊內容
    

    Hello, World!

    {% endblock %}
    使用Flask-Bootstrap集成Twitter Bootstrap

    Bootstrap是Twitter開發的一個開源框架,它提供用戶界面組件可用于創建整潔且具有吸引力的網頁,而且這些網頁還能兼容所有現代Web瀏覽器。Bootstrap是客戶端框架,不會直接涉及服務器。可以在模板中引用Bootstrap的CSS和JavaScript文件。

    安裝Flask-Bootstrap擴展
    (venv)$ pip install flask-bootstrap
    
    hello.py: 初始化Flask-Bootstrap
    from falsk_bootstrap import Bootstrap
    # ...
    bootstrap = Bootstrap(app)
    
    使用Flask-Bootstrap的模板
    {% extends "bootstrap/base.html" %}
    
    {% block title%}Flasky{% endblock %}
    
    {% block navbar %}
    
    {% endblock %}
    
    {% block content %}
    
    {% endblock %} # 模板利用Bootstrap中的樣式進行了修改
    Flask-Bootstrap基模板中定義的塊
    塊名 說明
    doc 整個HTML文檔
    html_attribs 標簽的屬性
    html 標簽中的內容
    head 標簽中的內容
    title 標簽中的內容</td> </tr> <tr> <td>metas</td> <td>一組<meta>標簽</td> </tr> <tr> <td>styles</td> <td>層疊樣式表定義</td> </tr> <tr> <td>body_attribs</td> <td><body>標簽的屬性</td> </tr> <tr> <td>body</td> <td><body>標簽中的內容</td> </tr> <tr> <td>navbar</td> <td>用戶定義的導航條</td> </tr> <tr> <td>content</td> <td>用戶定義的頁面內容</td> </tr> <tr> <td>scripts</td> <td>文檔底部的JavaScript聲明</td> </tr> </tbody> </table> <b>自定義錯誤頁面</b> <pre> <p>利用Jinja2的模板繼承機制可以讓templates/base.html繼承自bootstrap/base.html。</p> <pre>{% extends "bootstrap/base.html" %} {% block title %}Flasky{% endblock %} {% block navbar %} <div id="cg2ok20" class="navbar navbar-inverse" role="navigation"> <div id="2qguwwk" class="container"> <div id="ysmeiu2" class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span id="2smq2cc" class="sr-only">Toggle navigation</span> <span id="waqgyy2" class="icon-bar"></span> <span id="swgiyi2" class="icon-bar"></span> <span id="w2g0aw2" class="icon-bar"></span> </button> <a class="navbar-brand" href="/">Flasky</a> </div> <div id="2wci0wu" class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li><a href="/">Home</a></li> </ul> </div> </div> </div> {% endblock %} {% block content %} <div id="goi0ooq" class="container"> {% block page_content %}{% endblock %} </div> {% endblock %} </pre> <p>程序現在使用的模板繼承自templates/base.html不是直接繼承自Flask-Bootstrap的基模板。</p> </pre> <pre>404錯誤頁面:繼承自templates/base.html {% extends "base.html" %} {% block title %}Flasky - Page Not Found{% endblock %} {% block page_content %} <div id="2c0meom" class="page-header"> <h1>Not Found</h1> </div> {% endblock %} user頁面:繼承自templates/base.html {% extends "base.html" %} {% block title %}Flasky{% endblock %} {% block page_content %} <div id="2cw0aam" class="page-header"> <h1>Hello, {{ name }}!</h1> </div> {% endblock %} </pre> <b>鏈接</b> <pre><p>Flask提供了url_for()輔助函數,它可以使用程序URL映射中保存的信息生成URL。</p></pre> <p><p>url_for函數最簡單的用法:以視圖函數名作為參數,返回對應的URL。url_for("index")得到的結果是"/"</p></p> <p><p>使用url_for生成動態地址時,將動態部分作為關鍵字參數傳入。<br>url_for("user",name="john",_external=True)</p></p> <p><p>函數能將任何額外參數添加到查詢字符串中。</p></p> <b>靜態文件</b> <b>使用Flask-Moment本地化日期和時間</b> <pre><p>Flask-Moment是Flask的一個程序擴展,能夠在瀏覽器中渲染日期和時間。</p></pre> <p>安裝Flask-Moment</p> <pre>(venv)$ pip install flask-moment </pre> <b>hello.py:初始化Flask-Moment</b> <pre>from flask_moment import Moment moment = Moment(app) </pre> <b>templates/base.html: 引入 moment.js庫</b> <pre>{% block scripts %} {{ super() }} {{ moment.include_moment() }} {% endblock %} </pre> <b>hello.py: 加入一個datetime變量</b> <pre>from date.time import datetime @app.route("/") def index(): return render_template("index.html",current_time=datetime.utcnow()) </pre> <b>templates/index.html: 使用Flask-Moment渲染時間戳</b> <pre><p>The local date and time is {{ moment(current_time).format("LLL") }}.</p> <p>That was {{ moment(current_time).fromNow(refresh=True) }}.</p> </pre> <hr> <p>本文由?<strong>EverFighting</strong>?創作,采用?**[知識共享署名 3.0 中國大陸許可協議]</p> </div> <div id="yoiogui" class="mt-64 tags-seach" > <div id="kgme2cq" class="tags-info"> <a style="width:120px;" title="GPU云服務器" href="http://specialneedsforspecialkids.com/site/product/gpu.html">GPU云服務器</a> <a style="width:120px;" title="云服務器" href="http://specialneedsforspecialkids.com/site/active/kuaijiesale.html?ytag=seo">云服務器</a> <a style="width:120px;" title="Flask_Web" href="http://specialneedsforspecialkids.com/yun/tag/Flask_Web/">Flask_Web</a> <a style="width:120px;" title="web模板" href="http://specialneedsforspecialkids.com/yun/tag/webmoban/">web模板</a> <a style="width:120px;" title="web前端模板" href="http://specialneedsforspecialkids.com/yun/tag/webqianduanmoban/">web前端模板</a> <a style="width:120px;" title="小程序開發模板" href="http://specialneedsforspecialkids.com/yun/tag/xiaochengxukaifamoban/">小程序開發模板</a> </div> </div> <div id="kswye00" class="entry-copyright mb-30"> <p class="mb-15"> 文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。</p> <p>轉載請注明本文地址:http://specialneedsforspecialkids.com/yun/38104.html</p> </div> <ul class="pre-next-page"> <li id="oi2iui0" class="ellipsis"><a class="hpf" href="http://specialneedsforspecialkids.com/yun/38103.html">上一篇:pyenv 安裝配置與國內鏡像加速 結合 virtualenv</a></li> <li id="swociug" class="ellipsis"><a class="hpf" href="http://specialneedsforspecialkids.com/yun/38105.html">下一篇:SICP Python描述 1.1 引言</a></li> </ul> </div> <div id="msw0c2c" class="about_topicone-mid"> <h3 class="top-com-title mb-0"><span data-id="0">相關文章</span></h3> <ul class="com_white-left-mid atricle-list-box"> <li> <div id="m200mcc" class="atricle-list-right"> <h2 class="ellipsis2"><a class="hpf" href="http://specialneedsforspecialkids.com/yun/44228.html"><b>從零開始搭建論壇(三):<em>Flask</em>框架簡單介紹</b></a></h2> <p class="ellipsis2 good">摘要:我們的論壇項目就使用了該框架。此外,麥子學院也有一個入門視頻教程,一共小時的視頻教程,涵蓋開發的方方面面,包括環境的搭建,語法介紹,項目結構的組織,全球化,單元測試等內容。博客地址更多閱讀的機制三個框架的對比 前面兩篇文章中我們已經了解 Web(HTTP)服務器,Web應用程序,Web框架,WSGI這些 Python Web 開發中的概念。我們知道,Web框架通過將不同Web應用程序中...</p> <div id="imssmyw" class="com_white-left-info"> <div id="cwaqe0o" class="com_white-left-infol"> <a href="http://specialneedsforspecialkids.com/yun/u-1211.html"><img src="http://specialneedsforspecialkids.com/yun/data/avatar/000/00/12/small_000001211.jpg" alt=""><span id="c2myqes" class="layui-hide64">Alan</span></a> <time datetime="">2019-07-31 10:51</time> <span><i class="fa fa-commenting"></i>評論0</span> <span><i class="fa fa-star"></i>收藏0</span> </div> </div> </div> </li> <li> <div id="c2uwoyy" class="atricle-list-right"> <h2 class="ellipsis2"><a class="hpf" href="http://specialneedsforspecialkids.com/yun/44942.html"><b><em>Flask</em>框架基礎(二)</b></a></h2> <p class="ellipsis2 good">摘要:處理和函數之間關系的程序稱為路由。模板引擎是由實現的是內置的模板語言參照設計思想設計的,跟差不多渲染模板默認情況下,在程序文件夾中的子文件夾中尋找模板。如果需要可在文件夾中使用子文件夾存放文件。 1 程序的基本結構 1.1初始化 所有Flask 程序都必須創建一個程序實例。Web 服務器使用一種名為Web 服務器網關接口(Web Server Gateway Interface,WSG...</p> <div id="y2e0wmk" class="com_white-left-info"> <div id="4sa0gsw" class="com_white-left-infol"> <a href="http://specialneedsforspecialkids.com/yun/u-599.html"><img src="http://specialneedsforspecialkids.com/yun/data/avatar/000/00/05/small_000000599.jpg" alt=""><span id="qokoiki" class="layui-hide64">lpjustdoit</span></a> <time datetime="">2019-07-31 11:17</time> <span><i class="fa fa-commenting"></i>評論0</span> <span><i class="fa fa-star"></i>收藏0</span> </div> </div> </div> </li> <li> <div id="4mu2aoa" class="atricle-list-right"> <h2 class="ellipsis2"><a class="hpf" href="http://specialneedsforspecialkids.com/yun/122015.html"><b>最終篇:簡潔易懂,初學者挑戰學習Python編程30天 (五)</b></a></h2> <p class="ellipsis2 good">摘要:和是最受歡迎的。虛擬環境將允許將項目依賴項與本地機器依賴項隔離開來。文件將是項目中的主文件。運行后,檢查本地主機。在中創建一個名為的文件夾,并創建一個名為的文件夾。部署創建帳戶為前端和全棧應用程序提供免費部署服務。 ...</p> <div id="y2e02am" class="com_white-left-info"> <div id="akoqwig" class="com_white-left-infol"> <a href="http://specialneedsforspecialkids.com/yun/u-1154.html"><img src="http://specialneedsforspecialkids.com/yun/data/avatar/000/00/11/small_000001154.jpg" alt=""><span id="0qiass2" class="layui-hide64">1fe1se</span></a> <time datetime="">2021-10-09 09:44</time> <span><i class="fa fa-commenting"></i>評論0</span> <span><i class="fa fa-star"></i>收藏0</span> </div> </div> </div> </li> <li> <div id="yum0esg" class="atricle-list-right"> <h2 class="ellipsis2"><a class="hpf" href="http://specialneedsforspecialkids.com/yun/38373.html"><b><em>flask</em> 源碼解析:簡介</b></a></h2> <p class="ellipsis2 good">摘要:簡介官網上對它的定位是一個微開發框架。另外一個必須理解的概念是,簡單來說就是一套和框架應用之間的協議。功能比較豐富,支持解析自動防止攻擊繼承變量過濾器流程邏輯支持代碼邏輯集成等等。那么,從下一篇文章,我們就正式開始源碼之旅了 文章屬于作者原創,原文發布在個人博客。 flask 簡介 Flask 官網上對它的定位是一個微 python web 開發框架。 Flask is a micro...</p> <div id="cekye0s" class="com_white-left-info"> <div id="ee2qkgs" class="com_white-left-infol"> <a href="http://specialneedsforspecialkids.com/yun/u-141.html"><img src="http://specialneedsforspecialkids.com/yun/data/avatar/000/00/01/small_000000141.jpg" alt=""><span id="ykq2kyo" class="layui-hide64">megatron</span></a> <time datetime="">2019-07-25 11:23</time> <span><i class="fa fa-commenting"></i>評論0</span> <span><i class="fa fa-star"></i>收藏0</span> </div> </div> </div> </li> <li> <div id="0kee0ue" class="atricle-list-right"> <h2 class="ellipsis2"><a class="hpf" href="http://specialneedsforspecialkids.com/yun/41363.html"><b><em>flask</em>文檔學習筆記1-快速入門</b></a></h2> <p class="ellipsis2 good">摘要:示例如下靜態路由使用動態變量的路由未指定變量類型使用動態變量的路由指定變量類型指定的路由變量,可以作為被裝飾的函數參數傳入進來。 開始決定認真的在網上寫一些東西,主要原因還是在于希望能提升學習效果。雖說python寫了有幾年,但是web后端框架的確沒怎么接觸過,買了本狗書寥寥草草的過了一遍,發現很多東西還是理解不深,真的是好記性不如爛筆頭,知識也要從基礎開始,退回來好好看看官方文檔,再...</p> <div id="ukoqki0" class="com_white-left-info"> <div id="k20oy0q" class="com_white-left-infol"> <a href="http://specialneedsforspecialkids.com/yun/u-1342.html"><img src="http://specialneedsforspecialkids.com/yun/data/avatar/000/00/13/small_000001342.jpg" alt=""><span id="iqw2cyy" class="layui-hide64">lingdududu</span></a> <time datetime="">2019-07-30 15:37</time> <span><i class="fa fa-commenting"></i>評論0</span> <span><i class="fa fa-star"></i>收藏0</span> </div> </div> </div> </li> </ul> </div> <div id="m2ao0ck" class="topicone-box-wangeditor"> <h3 class="top-com-title mb-64"><span>發表評論</span></h3> <div id="ksyaqak" class="xcp-publish-main flex_box_zd"> <div id="u2aukgu" class="unlogin-pinglun-box"> <a href="javascript:login()" class="grad">登陸后可評論</a> </div> </div> </div> <div id="ue20eec" class="site-box-content"> <div id="2ce0iuk" class="site-content-title"> <h3 class="top-com-title mb-64"><span>0條評論</span></h3> </div> <div id="e2cq0s0" class="pages"></ul></div> </div> </div> <div id="gsmse0y" class="layui-col-md4 layui-col-lg3 com_white-right site-wrap-right"> <div id="sogwcqm" class=""> <div id="omaaqa2" class="com_layuiright-box user-msgbox"> <a href="http://specialneedsforspecialkids.com/yun/u-158.html"><img src="http://specialneedsforspecialkids.com/yun/data/avatar/000/00/01/small_000000158.jpg" alt=""></a> <h3><a href="http://specialneedsforspecialkids.com/yun/u-158.html" rel="nofollow">mochixuan</a></h3> <h6>男<span>|</span>高級講師</h6> <div id="cqy0es0" class="flex_box_zd user-msgbox-atten"> <a href="javascript:attentto_user(158)" id="attenttouser_158" class="grad follow-btn notfollow attention">我要關注</a> <a href="javascript:login()" title="發私信" >我要私信</a> </div> <div id="miyssg0" class="user-msgbox-list flex_box_zd"> <h3 class="hpf">TA的文章</h3> <a href="http://specialneedsforspecialkids.com/yun/ut-158.html" class="box_hxjz">閱讀更多</a> </div> <ul class="user-msgbox-ul"> <li><h3 class="ellipsis"><a href="http://specialneedsforspecialkids.com/yun/130984.html">tensorflow</a></h3> <p>閱讀 1534<span>·</span>2023-04-26 02:50</p></li> <li><h3 class="ellipsis"><a href="http://specialneedsforspecialkids.com/yun/130850.html">gpu版本的tensorflow</a></h3> <p>閱讀 3535<span>·</span>2023-04-26 00:28</p></li> <li><h3 class="ellipsis"><a href="http://specialneedsforspecialkids.com/yun/130632.html">tensorflow怎么安裝</a></h3> <p>閱讀 1931<span>·</span>2023-04-25 15:18</p></li> <li><h3 class="ellipsis"><a href="http://specialneedsforspecialkids.com/yun/124888.html">#黑五#TmhHost:1核/1G/10Mbps/日本CN2/季付200元,充值送10%,洛杉磯99</a></h3> <p>閱讀 3209<span>·</span>2021-11-24 10:31</p></li> <li><h3 class="ellipsis"><a href="http://specialneedsforspecialkids.com/yun/115231.html">CSS像素(css pixel)及像素單位 例如px pt em</a></h3> <p>閱讀 986<span>·</span>2019-08-30 13:00</p></li> <li><h3 class="ellipsis"><a href="http://specialneedsforspecialkids.com/yun/113247.html">DOM3中的自定義事件</a></h3> <p>閱讀 1000<span>·</span>2019-08-29 15:19</p></li> <li><h3 class="ellipsis"><a href="http://specialneedsforspecialkids.com/yun/112405.html">前端學習資源</a></h3> <p>閱讀 1766<span>·</span>2019-08-29 13:09</p></li> <li><h3 class="ellipsis"><a href="http://specialneedsforspecialkids.com/yun/112365.html">vue組件之間的通信</a></h3> <p>閱讀 2975<span>·</span>2019-08-29 13:06</p></li> </ul> </div> <!-- 文章詳情右側廣告--> <div id="eqgu2ym" class="com_layuiright-box"> <h6 class="top-com-title"><span>最新活動</span></h6> <div id="es0iac0" class="com_adbox"> <div id="2siy0cm" class="layui-carousel" id="right-item"> <div carousel-item> <div> <a href="http://specialneedsforspecialkids.com/site/active/kuaijiesale.html?ytag=seo" rel="nofollow"> <img src="http://specialneedsforspecialkids.com/yun/data/attach/240625/2rTjEHmi.png" alt="云服務器"> </a> </div> <div> <a href="http://specialneedsforspecialkids.com/site/product/gpu.html" rel="nofollow"> <img src="http://specialneedsforspecialkids.com/yun/data/attach/240807/7NjZjdrd.png" alt="GPU云服務器"> </a> </div> </div> </div> </div> <!-- banner結束 --> <div id="kwo0i0g" class="adhtml"> </div> <script> $(function(){ $.ajax({ type: "GET", url:"http://specialneedsforspecialkids.com/yun/ad/getad/1.html", cache: false, success: function(text){ $(".adhtml").html(text); } }); }) </script> </div> </div> </div> </div> </div> </section> <!-- wap拉出按鈕 --> <div id="m2cim2u" class="site-tree-mobile layui-hide"> <i class="layui-icon layui-icon-spread-left"></i> </div> <!-- wap遮罩層 --> <div id="ywyqwi0" class="site-mobile-shade"></div> <!--付費閱讀 --> <div class="wg00ky0" id="payread"> <div id="0mqgy2g" class="layui-form-item">閱讀需要支付1元查看</div> <div id="2wym2iy" class="layui-form-item"><button class="btn-right">支付并查看</button></div> </div> <script> var prei=0; $(".site-seo-depict pre").each(function(){ var html=$(this).html().replace("<code>","").replace("</code>","").replace('<code class="javascript hljs" codemark="1">',''); $(this).attr('data-clipboard-text',html).attr("id","pre"+prei); $(this).html("").append("<code>"+html+"</code>"); prei++; }) $(".site-seo-depict img").each(function(){ if($(this).attr("src").indexOf('data:image/svg+xml')!= -1){ $(this).remove(); } }) $("LINK[href*='style-49037e4d27.css']").remove(); $("LINK[href*='markdown_views-d7a94ec6ab.css']").remove(); layui.use(['jquery', 'layer','code'], function(){ $("pre").attr("class","layui-code"); $("pre").attr("lay-title",""); $("pre").attr("lay-skin",""); layui.code(); $(".layui-code-h3 a").attr("class","copycode").html("復制代碼 ").attr("onclick","copycode(this)"); }); function copycode(target){ var id=$(target).parent().parent().attr("id"); var clipboard = new ClipboardJS("#"+id); clipboard.on('success', function(e) { e.clearSelection(); alert("復制成功") }); clipboard.on('error', function(e) { alert("復制失敗") }); } //$(".site-seo-depict").html($(".site-seo-depict").html().slice(0, -5)); </script> <link rel="stylesheet" type="text/css" href="http://specialneedsforspecialkids.com/yun/static/js/neweditor/code/styles/tomorrow-night-eighties.css"> <script src="http://specialneedsforspecialkids.com/yun/static/js/neweditor/code/highlight.pack.js" type="text/javascript"></script> <script src="http://specialneedsforspecialkids.com/yun/static/js/clipboard.js"></script> <script>hljs.initHighlightingOnLoad();</script> <script> function setcode(){ var _html=''; document.querySelectorAll('pre code').forEach((block) => { var _tmptext=$.trim($(block).text()); if(_tmptext!=''){ _html=_html+_tmptext; console.log(_html); } }); } </script> <script> function payread(){ layer.open({ type: 1, title:"付費閱讀", shadeClose: true, content: $('#payread') }); } // 舉報 function jupao_tip(){ layer.open({ type: 1, title:false, shadeClose: true, content: $('#jubao') }); } $(".getcommentlist").click(function(){ var _id=$(this).attr("dataid"); var _tid=$(this).attr("datatid"); $("#articlecommentlist"+_id).toggleClass("hide"); var flag=$("#articlecommentlist"+_id).attr("dataflag"); if(flag==1){ flag=0; }else{ flag=1; //加載評論 loadarticlecommentlist(_id,_tid); } $("#articlecommentlist"+_id).attr("dataflag",flag); }) $(".add-comment-btn").click(function(){ var _id=$(this).attr("dataid"); $(".formcomment"+_id).toggleClass("hide"); }) $(".btn-sendartcomment").click(function(){ var _aid=$(this).attr("dataid"); var _tid=$(this).attr("datatid"); var _content=$.trim($(".commenttext"+_aid).val()); if(_content==''){ alert("評論內容不能為空"); return false; } var touid=$("#btnsendcomment"+_aid).attr("touid"); if(touid==null){ touid=0; } addarticlecomment(_tid,_aid,_content,touid); }) $(".button_agree").click(function(){ var supportobj = $(this); var tid = $(this).attr("id"); $.ajax({ type: "GET", url:"http://specialneedsforspecialkids.com/yun/index.php?topic/ajaxhassupport/" + tid, cache: false, success: function(hassupport){ if (hassupport != '1'){ $.ajax({ type: "GET", cache:false, url: "http://specialneedsforspecialkids.com/yun/index.php?topic/ajaxaddsupport/" + tid, success: function(comments) { supportobj.find("span").html(comments+"人贊"); } }); }else{ alert("您已經贊過"); } } }); }); function attenquestion(_tid,_rs){ $.ajax({ //提交數據的類型 POST GET type:"POST", //提交的網址 url:"http://specialneedsforspecialkids.com/yun/favorite/topicadd.html", //提交的數據 data:{tid:_tid,rs:_rs}, //返回數據的格式 datatype: "json",//"xml", "html", "script", "json", "jsonp", "text". //在請求之前調用的函數 beforeSend:function(){}, //成功返回之后調用的函數 success:function(data){ var data=eval("("+data+")"); console.log(data) if(data.code==2000){ layer.msg(data.msg,function(){ if(data.rs==1){ //取消收藏 $(".layui-layer-tips").attr("data-tips","收藏文章"); $(".layui-layer-tips").html('<i class="fa fa-heart-o"></i>'); } if(data.rs==0){ //收藏成功 $(".layui-layer-tips").attr("data-tips","已收藏文章"); $(".layui-layer-tips").html('<i class="fa fa-heart"></i>') } }) }else{ layer.msg(data.msg) } } , //調用執行后調用的函數 complete: function(XMLHttpRequest, textStatus){ postadopt=true; }, //調用出錯執行的函數 error: function(){ //請求出錯處理 postadopt=false; } }); } </script> <footer> <div id="2wa0ues" class="layui-container"> <div id="sae0amc" class="flex_box_zd"> <div id="aga2iii" class="left-footer"> <h6><a href="http://specialneedsforspecialkids.com/"><img src="http://specialneedsforspecialkids.com/yun/static/theme/ukd//images/logo.png" alt="UCloud (優刻得科技股份有限公司)"></a></h6> <p>UCloud (優刻得科技股份有限公司)是中立、安全的云計算服務平臺,堅持中立,不涉足客戶業務領域。公司自主研發IaaS、PaaS、大數據流通平臺、AI服務平臺等一系列云計算產品,并深入了解互聯網、傳統企業在不同場景下的業務需求,提供公有云、混合云、私有云、專有云在內的綜合性行業解決方案。</p> </div> <div id="22c2kyk" class="right-footer layui-hidemd"> <ul class="flex_box_zd"> <li> <h6>UCloud與云服務</h6> <p><a href="http://specialneedsforspecialkids.com/site/about/intro/">公司介紹</a></p> <p><a >加入我們</a></p> <p><a href="http://specialneedsforspecialkids.com/site/ucan/onlineclass/">UCan線上公開課</a></p> <p><a href="http://specialneedsforspecialkids.com/site/solutions.html" >行業解決方案</a></p> <p><a href="http://specialneedsforspecialkids.com/site/pro-notice/">產品動態</a></p> </li> <li> <h6>友情鏈接</h6> <p><a >GPU算力平臺</a></p> <p><a >UCloud私有云</a></p> <p><a >SurferCloud</a></p> <p><a >工廠仿真軟件</a></p> <p><a >Pinex</a></p> <p><a >AI繪畫</a></p> </li> <li> <h6>社區欄目</h6> <p><a href="http://specialneedsforspecialkids.com/yun/column/index.html">專欄文章</a></p> <p><a href="http://specialneedsforspecialkids.com/yun/udata/">專題地圖</a></p> </li> <li> <h6>常見問題</h6> <p><a href="http://specialneedsforspecialkids.com/site/ucsafe/notice.html" >安全中心</a></p> <p><a href="http://specialneedsforspecialkids.com/site/about/news/recent/" >新聞動態</a></p> <p><a href="http://specialneedsforspecialkids.com/site/about/news/report/">媒體動態</a></p> <p><a href="http://specialneedsforspecialkids.com/site/cases.html">客戶案例</a></p> <p><a href="http://specialneedsforspecialkids.com/site/notice/">公告</a></p> </li> <li> <span><img src="https://static.ucloud.cn/7a4b6983f4b94bcb97380adc5d073865.png" alt="優刻得"></span> <p>掃掃了解更多</p></div> </div> <div id="sugw2gu" class="copyright">Copyright ? 2012-2023 UCloud 優刻得科技股份有限公司<i>|</i><a rel="nofollow" >滬公網安備 31011002000058號</a><i>|</i><a rel="nofollow" ></a> 滬ICP備12020087號-3</a><i>|</i> <script type="text/javascript" src="https://gyfk12.kuaishang.cn/bs/ks.j?cI=197688&fI=125915" charset="utf-8"></script> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?290c2650b305fc9fff0dbdcafe48b59d"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-DZSMXQ3P9N"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-DZSMXQ3P9N'); </script> <script> (function(){ var el = document.createElement("script"); el.src = "https://lf1-cdn-tos.bytegoofy.com/goofy/ttzz/push.js?99f50ea166557aed914eb4a66a7a70a4709cbb98a54ecb576877d99556fb4bfc3d72cd14f8a76432df3935ab77ec54f830517b3cb210f7fd334f50ccb772134a"; el.id = "ttzz"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(el, s); })(window) </script></div> </div> </footer> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://specialneedsforspecialkids.com/" title="国产xxxx99真实实拍">国产xxxx99真实实拍</a> <div class="friend-links"> <a href="http://belistarlp.com/">国产黄色在线</a> </div> </div> </footer> <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body><div id="wuika" class="pl_css_ganrao" style="display: none;"><tbody id="wuika"><source id="wuika"><small id="wuika"></small></source></tbody><bdo id="wuika"></bdo><nav id="wuika"></nav><acronym id="wuika"></acronym><dd id="wuika"></dd><code id="wuika"></code><xmp id="wuika"></xmp><blockquote id="wuika"></blockquote><dd id="wuika"></dd><th id="wuika"><menu id="wuika"><noscript id="wuika"></noscript></menu></th><tr id="wuika"></tr><abbr id="wuika"></abbr><button id="wuika"><blockquote id="wuika"><tfoot id="wuika"></tfoot></blockquote></button><th id="wuika"></th><table id="wuika"></table><wbr id="wuika"><cite id="wuika"><nav id="wuika"></nav></cite></wbr><pre id="wuika"><blockquote id="wuika"><dl id="wuika"></dl></blockquote></pre><td id="wuika"></td><center id="wuika"></center><wbr id="wuika"></wbr><tbody id="wuika"><object id="wuika"><small id="wuika"></small></object></tbody><optgroup id="wuika"></optgroup><source id="wuika"></source><delect id="wuika"></delect><kbd id="wuika"></kbd><rt id="wuika"></rt><bdo id="wuika"></bdo><tbody id="wuika"></tbody><dd id="wuika"></dd><center id="wuika"><dl id="wuika"><optgroup id="wuika"></optgroup></dl></center><tbody id="wuika"></tbody><em id="wuika"></em><wbr id="wuika"></wbr><bdo id="wuika"></bdo><dd id="wuika"></dd><strong id="wuika"></strong><kbd id="wuika"></kbd><rt id="wuika"></rt><input id="wuika"></input><table id="wuika"><del id="wuika"><dfn id="wuika"></dfn></del></table><blockquote id="wuika"></blockquote><object id="wuika"></object><input id="wuika"><tbody id="wuika"><button id="wuika"></button></tbody></input><button id="wuika"></button><delect id="wuika"></delect><ul id="wuika"><pre id="wuika"><source id="wuika"></source></pre></ul><dfn id="wuika"></dfn><pre id="wuika"><wbr id="wuika"><cite id="wuika"></cite></wbr></pre><pre id="wuika"></pre><abbr id="wuika"></abbr><sup id="wuika"></sup><dfn id="wuika"></dfn><pre id="wuika"></pre><bdo id="wuika"></bdo><s id="wuika"><noscript id="wuika"><em id="wuika"></em></noscript></s><abbr id="wuika"><pre id="wuika"><blockquote id="wuika"></blockquote></pre></abbr><del id="wuika"></del><samp id="wuika"><tbody id="wuika"><source id="wuika"></source></tbody></samp><s id="wuika"><noscript id="wuika"><option id="wuika"></option></noscript></s><tbody id="wuika"></tbody><blockquote id="wuika"></blockquote><ul id="wuika"></ul><small id="wuika"></small><tbody id="wuika"></tbody><kbd id="wuika"></kbd><nav id="wuika"></nav><noscript id="wuika"><acronym id="wuika"><delect id="wuika"></delect></acronym></noscript><source id="wuika"></source><bdo id="wuika"></bdo><li id="wuika"><acronym id="wuika"><xmp id="wuika"></xmp></acronym></li><tbody id="wuika"><button id="wuika"><blockquote id="wuika"></blockquote></button></tbody><center id="wuika"><dd id="wuika"><th id="wuika"></th></dd></center><strong id="wuika"><noframes id="wuika"><kbd id="wuika"></kbd></noframes></strong><blockquote id="wuika"></blockquote><source id="wuika"></source><em id="wuika"></em><button id="wuika"></button><tbody id="wuika"></tbody><wbr id="wuika"></wbr><nav id="wuika"></nav><bdo id="wuika"></bdo><small id="wuika"></small><wbr id="wuika"><cite id="wuika"><nav id="wuika"></nav></cite></wbr><bdo id="wuika"></bdo><menu id="wuika"></menu><dfn id="wuika"></dfn><s id="wuika"></s><strong id="wuika"><abbr id="wuika"><kbd id="wuika"></kbd></abbr></strong><small id="wuika"></small><em id="wuika"></em><cite id="wuika"><nav id="wuika"><li id="wuika"></li></nav></cite><em id="wuika"><del id="wuika"><dfn id="wuika"></dfn></del></em><dl id="wuika"></dl><blockquote id="wuika"><tfoot id="wuika"><input id="wuika"></input></tfoot></blockquote><abbr id="wuika"></abbr><th id="wuika"></th><sup id="wuika"></sup><del id="wuika"><dfn id="wuika"><rt id="wuika"></rt></dfn></del><samp id="wuika"></samp><center id="wuika"><dd id="wuika"><th id="wuika"></th></dd></center><noframes id="wuika"></noframes><tfoot id="wuika"></tfoot><tbody id="wuika"></tbody><tbody id="wuika"><source id="wuika"><cite id="wuika"></cite></source></tbody><tbody id="wuika"></tbody><ul id="wuika"><pre id="wuika"><wbr id="wuika"></wbr></pre></ul><pre id="wuika"></pre><strike id="wuika"></strike><th id="wuika"></th><pre id="wuika"></pre><tbody id="wuika"></tbody><th id="wuika"></th><dl id="wuika"></dl><input id="wuika"></input><button id="wuika"></button><pre id="wuika"></pre><fieldset id="wuika"></fieldset><noscript id="wuika"></noscript><abbr id="wuika"><ul id="wuika"><center id="wuika"></center></ul></abbr><pre id="wuika"></pre><samp id="wuika"><pre id="wuika"><source id="wuika"></source></pre></samp><center id="wuika"></center><xmp id="wuika"></xmp><tfoot id="wuika"></tfoot><abbr id="wuika"></abbr><abbr id="wuika"><pre id="wuika"><samp id="wuika"></samp></pre></abbr><del id="wuika"></del><bdo id="wuika"></bdo><optgroup id="wuika"></optgroup><nav id="wuika"></nav><dl id="wuika"></dl><tbody id="wuika"></tbody><xmp id="wuika"></xmp><tbody id="wuika"></tbody><table id="wuika"></table><s id="wuika"><bdo id="wuika"><table id="wuika"></table></bdo></s><td id="wuika"><fieldset id="wuika"><optgroup id="wuika"></optgroup></fieldset></td><noframes id="wuika"></noframes><optgroup id="wuika"></optgroup><tr id="wuika"><dfn id="wuika"><center id="wuika"></center></dfn></tr><tbody id="wuika"></tbody><kbd id="wuika"></kbd><acronym id="wuika"><xmp id="wuika"><strike id="wuika"></strike></xmp></acronym><abbr id="wuika"><pre id="wuika"><blockquote id="wuika"></blockquote></pre></abbr><small id="wuika"></small><strike id="wuika"><rt id="wuika"><bdo id="wuika"></bdo></rt></strike><pre id="wuika"></pre><td id="wuika"></td><fieldset id="wuika"></fieldset><kbd id="wuika"></kbd></div> <script src="http://specialneedsforspecialkids.com/yun/static/theme/ukd/js/common.js"></script> <<script type="text/javascript"> $(".site-seo-depict *,.site-content-answer-body *,.site-body-depict *").css("max-width","100%"); </script> </html>