찾다
위챗 애플릿위챗 개발WeChat 개발 마이크로사이트 jquery_mobile 사례 분석

이 강의에서는 주로 jquery_mobile을 사용하여 영화를 재생하는 웹사이트를 구현합니다.

jquery_mobile(줄여서 JQM)은 실제로 모바일 클라이언트의 탐색 요구 사항에 맞게 jquery를 기반으로 개발된 모바일 프레임워크 세트입니다.

jquery_mobile 컨트롤 소개

jquery_mobile의 구문은 데이터 역할 형식으로 각 컨트롤(위젯)의 스타일을 정의합니다. 직접 인용하여 휴대폰에 적합한 페이지 표시 스타일입니다.

juqery_mobile의 일반적인 컨트롤은 다음과 같습니다:

WeChat 개발 마이크로사이트 jquery_mobile 사례 분석

더 이상 고민하지 말고 첫 번째 jquery_mobile 템플릿 프로그램을 작성하고 이름을 jqm1.html로 바꾸겠습니다. 코드는 다음과 같습니다:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <!--宽高禁缩放 -->
        <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
        <!--类webapp--> 
        <meta name="apple-mobile-web-app-capable" content="yes">
        <!--状态条 --> 
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <!--电话号码不是链接 --> 
        <meta name="format-detection" content="telephone=no">
        <title>jQuery Mobile Web 应用程序</title>
        <link href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" rel="stylesheet" type="text/css"/>
        <script src="http://code.jquery.com/jquery-1.6.4.min.js" type="text/javascript"></script>
        <script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js" type="text/javascript"></script>
    </head>
    <body>
        <div data-role="page" id="page1">
            <div data-role="header">
                <h1 id="header">header</h1>
            </div>
            <div data-role="content">
                <ul data-role="listview">
                    <li><a href="#page1">第一页</a></li>
                    <li><a href="#page2">第二页</a></li>
                    <li><a href="#page3">第三页</a></li>
                    <li><a href="#page4">第四页</a></li>
                    <li><a href="#page5">第五页</a></li>
                </ul>
            </div>
            <div data-role="footer">
                <h1 id="页面脚注">页面脚注</h1>
            </div>
        </div>
        
        <div data-role="page" id="page2">
            <div data-role="header">
                <h1 id="header">header2</h1>
            </div>
            <div data-role="content">
                <img  src="/static/imghwm/default1.png"  data-src="http://i.cnblogs.com/images/adminlogo.gif"  class="lazy"     style="max-width:90%"  / alt="WeChat 개발 마이크로사이트 jquery_mobile 사례 분석" >
            </div>
            <div data-role="footer">
                <h1 id="页面脚注">页面脚注</h1>
            </div>
        </div>
        
        <div data-role="page" id="page3">
            <div data-role="header">
                <h1 id="header">header3</h1>
            </div>
            <div data-role="content">
                内容3
            </div>
            <div data-role="footer">
                <h1 id="footer">footer3</h1>
            </div>
        </div>
        
        <div data-role="page" id="page4">
            <div data-role="header">
                <h1 id="header">header4</h1>
            </div>
            <div data-role="content">
                <b>内容4</b>
            </div>
            <div data-role="footer">
                <h1 id="footer-nbsp-nbsp-nbsp-nbsp">footer4    </h1>
            </div>
        </div>
        
        <div data-role="page" id="page5">
            <div data-role="header">
                <h1 id="header">header5</h1>
            </div>
            <div data-role="content">
                <h1 id="内容">内容5</h1>
            </div>
            <div data-role="footer">
                <h1 id="footer">footer5</h1>
            </div>
        </div>
    </body>
<html>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <!--宽高禁缩放 -->
        <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
        <!--类webapp--> 
        <meta name="apple-mobile-web-app-capable" content="yes">
        <!--状态条 --> 
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <!--电话号码不是链接 --> 
        <meta name="format-detection" content="telephone=no">
        <title>jQuery Mobile Web 应用程序</title>
        <link href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" rel="stylesheet" type="text/css"/>
        <script src="http://code.jquery.com/jquery-1.6.4.min.js" type="text/javascript"></script>
        <script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js" type="text/javascript"></script>
    </head>
    <body>
        <div data-role="page" id="page1">
            <div data-role="header">
                <h1 id="header">header</h1>
            </div>
            <div data-role="content">
                <ul data-role="listview">
                    <li><a href="#page1">第一页</a></li>
                    <li><a href="#page2">第二页</a></li>
                    <li><a href="#page3">第三页</a></li>
                    <li><a href="#page4">第四页</a></li>
                    <li><a href="#page5">第五页</a></li>
                </ul>
            </div>
            <div data-role="footer">
                <h1 id="页面脚注">页面脚注</h1>
            </div>
        </div>
        
        <div data-role="page" id="page2">
            <div data-role="header">
                <h1 id="header">header2</h1>
            </div>
            <div data-role="content">
                <img  src="/static/imghwm/default1.png"  data-src="http://i.cnblogs.com/images/adminlogo.gif"  class="lazy"     style="max-width:90%"  / alt="WeChat 개발 마이크로사이트 jquery_mobile 사례 분석" >
            </div>
            <div data-role="footer">
                <h1 id="页面脚注">页面脚注</h1>
            </div>
        </div>
        
        <div data-role="page" id="page3">
            <div data-role="header">
                <h1 id="header">header3</h1>
            </div>
            <div data-role="content">
                内容3
            </div>
            <div data-role="footer">
                <h1 id="footer">footer3</h1>
            </div>
        </div>
        
        <div data-role="page" id="page4">
            <div data-role="header">
                <h1 id="header">header4</h1>
            </div>
            <div data-role="content">
                <b>内容4</b>
            </div>
            <div data-role="footer">
                <h1 id="footer-nbsp-nbsp-nbsp-nbsp">footer4    </h1>
            </div>
        </div>
        
        <div data-role="page" id="page5">
            <div data-role="header">
                <h1 id="header">header5</h1>
            </div>
            <div data-role="content">
                <h1 id="内容">内容5</h1>
            </div>
            <div data-role="footer">
                <h1 id="footer">footer5</h1>
            </div>
        </div>
    </body>
<html>

위의 코드에서 jquery_mobile이 ecshop 백엔드에 제품을 추가하는 것과 마찬가지로 ID를 통해 다음 목록을 제어할 수 있다는 것을 확실히 이해할 수 있습니다.

What you 주의해야 할 것은 아래 그림과 같이 빨간색 테두리 안의 코드입니다:

WeChat 개발 마이크로사이트 jquery_mobile 사례 분석

그런 다음 주로 사용자가 언제 지정할 수 있도록 fs.php 프로그램을 작성합니다. 링크를 푸시하면 코드는 다음과 같습니다.

<?php
    header(&#39;content-type:text/html;charset=utf-8&#39;);
    require_once &#39;get_token.php&#39;;
    require_once &#39;common.php&#39;;
    //这时,也可以通过客户服务接口,把这个url地址发送给用户
    $contentStr = "体验一下jquery moible \n\n http://weixin.showtp.com/jqm1.html";
    $fromUsername = &#39;oB1_6tw1NBlGdqSsTCl5anZ7MEU4&#39;;
    //使用url编码
    $contentStr = urlencode($contentStr);
    $content_arr = array(&#39;content&#39; => "{$contentStr}");
    $reply_arr = array(&#39;touser&#39; => "{$fromUsername}", &#39;msgtype&#39; => &#39;text&#39;, &#39;text&#39; => $content_arr);
    //编码成json格式
    $post = json_encode($reply_arr);
    //url解码
    $post = urldecode($post);
    $url = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token={$access_token}";
    http_request($url, $post);
    echo &#39;发送成功!&#39;;

그런 다음 fs.php에 액세스하면 효과는 다음과 같습니다.

WeChat 개발 마이크로사이트 jquery_mobile 사례 분석

우리 휴대폰은 모든 링크를 수신합니다. 푸시된 정보를 클릭하여 입력할 수도 있으며 아래와 같이 브라우저를 축소하여 jquery_mobile의 성공적인 크기 조정 효과를 확인할 수도 있습니다.

WeChat 개발 마이크로사이트 jquery_mobile 사례 분석

위 내용은 WeChat 개발 마이크로사이트 jquery_mobile 사례 분석의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

Video Face Swap

Video Face Swap

완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

뜨거운 도구

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

맨티스BT

맨티스BT

Mantis는 제품 결함 추적을 돕기 위해 설계된 배포하기 쉬운 웹 기반 결함 추적 도구입니다. PHP, MySQL 및 웹 서버가 필요합니다. 데모 및 호스팅 서비스를 확인해 보세요.

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

SublimeText3 Linux 새 버전

SublimeText3 Linux 새 버전

SublimeText3 Linux 최신 버전

SecList

SecList

SecLists는 최고의 보안 테스터의 동반자입니다. 보안 평가 시 자주 사용되는 다양한 유형의 목록을 한 곳에 모아 놓은 것입니다. SecLists는 보안 테스터에게 필요할 수 있는 모든 목록을 편리하게 제공하여 보안 테스트를 더욱 효율적이고 생산적으로 만드는 데 도움이 됩니다. 목록 유형에는 사용자 이름, 비밀번호, URL, 퍼징 페이로드, 민감한 데이터 패턴, 웹 셸 등이 포함됩니다. 테스터는 이 저장소를 새로운 테스트 시스템으로 간단히 가져올 수 있으며 필요한 모든 유형의 목록에 액세스할 수 있습니다.