Back to Question Center
0

Nuna samfurin shigarwa ba tare da rubutun uwar garke ba - Semalt

1 answers:

Shin akwai hanyar da za a yarda da shigar da takardar shigarwa kuma a fitar da kayan aiki da aka buga / bugawa zuwa shafin yanar gizon tare da HTML ko JavaScript / AJAX kuma ba tare da rubutattun Semalt ba?

. Source - hosting for asp
February 8, 2018

Kashe saman kaina, zaka iya yin wani abu kamar

  
 Dump bayanai  Sunan  imel 
 

sa'an nan kuma wani bit na JavaScript (Ina amfani da jQuery, amma na tabbata za ka iya yin haka tare da JS na al'ada). Wannan zai yi wuta lokacin da aka gabatar da nau'in, ya haifar da birane daga dabi'un sannan ya fitar da su zuwa allon (bayan kasa na tsari)

  $ (rubutun). shirye (aikin 

{ $ ('nau'i. dump '). kowane (aiki

{$ (wannan). 'ya'yan (' fieldset '). 'ya'yan (' shigarwa ''. latsa (aiki

{// Bayyana duk wani kayan aiki na baya$ (wannan). iyaye ('fieldset'). iyaye ('siffar. dump '). 'yan'uwa ('. fitarwa "). cire

;// Ƙirƙirar varsvar nameVal = $ (wannan). 'yan'uwa (' shigarwa [id = "suna"] "). val

;Bada emailVal = $ (wannan). 'yan'uwa (' shigarwa [id = "imel") '). val

;// Kayan bayan tsari$ (wannan). iyaye ('fieldset'). iyaye ('siffar. dump '). bayan ('

Sunan shi ne' + nameVal + '

' +'

imel shine' + emailVal + '

');dawo da ƙarya; // Dakatar da burauzan da ke ƙoƙarin ba da tsari ɗin}); });

});

Hakika, akwai wasu abubuwa da za su tuna

  • Tabbatar cewa akwai mai dacewar JS fallback
  • Wannan ba kome ba ne tare da bayanai sai dai samar da shi zuwa shafin
  • Wannan ba ingantacce / sanitizing da dai sauransu
  • Zai yiwu ya zama hanya mafi kyau / mafi kyau, amma a ranar Litinin da safe ne kuma wannan shine abu na farko da zan iya yi a saman kaina; o)

Nuna sakamakon sakamako tare da HTML da CSS kawai

Yana yiwuwa a nuna samfurori ta hanyar amfani da HTML kawai da CSS tare da yin amfani da hankali na : zaɓaɓɓe mai zaɓa. Bayanan bayani a kasa da lambar.

Danna don demo mai rai. (Rubuta cikin akwatin a cikin "Result" taga kuma danna "Sauka". )

  <; doctype html>
 CSS takardar shaidar </ title><style style = "rubutu / css">/ * Sanya hanyar da ba ta ganuwa a kan maɓallin mikawa wanda zai socanza shafin da aka sanya lokacin da aka danna maɓallin sallamawa. N. B. Maballin sallama bai taba haifar dashi ba;Ya wanzu ne kawai don aiki a matsayin mai kai hari ga mai amfanida kuma biyan bukatun mai amfani da abin dawani nau'i ya kamata kama. * /Matsayin da za a ba da shi: cikakke; sama: 0; hagu: 0; tsawo: 100%; nisa: 70px; }/ * Ka boye 'Ka danna:' rubutu a kan shafi na farko * *#page p {nuni: babu}/ * A lokacin da #page ta zama manufa (a kan samfurin tsari),nuna 'Ka buga:' rubutu, ɓoye maɓallin sallama,kuma sake duba akwatin shigarwa a cikin rubutun rubutu. * /#page: manufa p {nuni: haɗin kai}#page: manufa shigarwa [type = "sallama"] {nuni: babu}#page: shigarwar shigar da hankali [nuni: raga-jerin-kwance; iyaka: 0px}</ style></ head><jiki><div id = "shafi na"><hanyar aiki = "" hanya = "post"><p> Ka danna: </p><nau'in shigarwa = "rubutu" /><div style = "matsayi: dangi"><nau'in shigarwa = "mika"> </ div></ form></ div></ body>
</ html></code> </pre><h3> Ta yaya yake aiki </h3><p> Kuna iya fahimtar ta daga sharuddan CSS code a sama, amma, idan kana so cikakken bayani, karanta a kan. </p><p> Na farko, maɓallin sallama na tsari yana da hanyar da ba ta ganuwa a sama da shi da muke yi tare da CSS: </p><pre> <code> <div style = "matsayi: dangi"><nau'in shigarwa = "mika"> 
</ div></code> </pre><p> <code> wani matsayi na sallama: cikakkiyar; sama: 0; hagu: 0; tsawo: 100%; nisa: 70px; } </code> </p><p> Lokacin da mai amfani ya danna maɓallin "Sauke", suna danna alamar marar ganuwa a sama da shi; mai amfani ba ya taɓa zauren Basus ɗin kuma naurar da kanta ba a taba sallama ba. </p><p> Abin da ya faru a maimakon haka shi ne, lokacin da aka danna mahada a kan maɓallin sallamawa, url ya canza daga shafin <code>. com / form. html </code> zuwa <code> shafin. com / form. html # shafi na </code>. Ba a sani ba, amma zaka iya amfani da <code> #page </code> wani ɓangare na URL a matsayin mai zaɓaɓɓen CSS tare da <code>: manufa </code> nau'in lissafi ( takardun a nan ). Wannan yana bamu damar yin amfani da shafi daban-daban idan akwai nau'in <code> #page </code> a cikin adireshin adireshin mai bincike. </p><p> Sabili da haka, lokacin da aka danna link kuma an yi amfani da mai amfani zuwa #page, zamu nuna 'Ka danna:' Rubutun, ɓoye maɓallin sallama, kuma canza saitin akwatin saƙo don nuna musu abin da suka buga. Dukkan wannan an yi ta amfani da <code>: manufa </code> mai zaɓa. </p><p> Dokar CSS wadda take kama da <code> #page: manufa p [nuni: inline} </code> ya ce "lokacin da #page shine manufa, nuna rubutu na layi a cikin layi. "Wannan ya sa akwatin shigarwa ya kasance a kan layi guda kamar sakin layi, maimakon ƙarƙashinsa. </p><p> Na gaba, layin da yake kama da <code> #page: manufa shigarwa [type = "sallama"] [nuni: babu} </code> boye maɓallin sallama lokacin da shafin shine manufa. </p><p> A karshe, layin da yake kama da <code> #page: shigarwar shigar da hanzari [nuni: sashin layi; iyakar: 0px} </code> yana nuna akwatin shigarwa kusa da sakon layi, kuma ya kawar da iyakar. Muna nuna mai amfani daidai wannan akwatin shigarwa da suka shiga kawai! Muna kawai salo ta daban. </p><p> Ana iya ƙara wannan tare da bayanai masu yawa idan an buƙata, amma Na yi amfani da ɗaya don kiyaye shi mai sauki. </p><p> Lura cewa goyon bayan mai bincike ga CSS <code>: mai zaɓin </code> mai kyau yana da kyau, amma IE8 da wasu masu bincike za suyi gwagwarmayar da shi. ( Jerin cikakke a nan. ) </p>                            </div>
                            <div class="comment-footer">
                                <!--                                    <div class="posted_at">-->
                                <!---->
                                <!--</div>-->
                                                            </div>
                        </div>
                                            <div class="comment-item">
                            <div class="comment-message">
                                <ul><li> Sanya id = "myform" a kan kashi </li><li> Ƙara id = "mysubmitbutton" zuwa maɓallin sallama a kan hanyar </li><li> Tabbatar kun hada da jQuery zuwa shafinku </li><li><p> ƙara wannan lambar code wani wuri a cikin shafinku </p><pre> <code> <rubutun rubutu = "rubutu / javascript">$ ("# mysubmitbutton"). a kan ("latsa", aikin <ul> {na'ura wasan bidiyo. shiga ($ ("# myform"). SerializeArray <ul>);dawo da ƙarya; // Kare ƙaddamarwar tsari});
</ script></code> </pre></li></ul><p> Bayan wadannan matakai ya kamata ka ga fitarwa ta fitarwa a na'urar ta mashigin ka. Zaka iya ɗaukar kayan fitarwa daga <code> $ ('# myform'). serializeArray <ul> </code> da kuma sanya shi a cikin wani akwati na HTML kawai ta javascript code, ba tare da ta hanyar PHP. </p>                            </div>
                            <div class="comment-footer">
                                <!--                                    <div class="posted_at">-->
                                <!---->
                                <!--</div>-->
                                                            </div>
                        </div>
                                    </div>
                        
        </div>
            </div>
</div>
</div>
</div>
</div>

<script src="/js/main.js?23" type="text/javascript"></script>
        <script src="/js/post.js" type="text/javascript"></script>
    <!--LiveInternet counter--><script type="text/javascript">
    new Image().src = "//counter.yadro.ru/hit;reputation?r"+
        escape(document.referrer)+((typeof(screen)=="undefined")?"":
            ";s"+screen.width+"*"+screen.height+"*"+(screen.colorDepth?
            screen.colorDepth:screen.pixelDepth))+";u"+escape(document.URL)+
        ";h"+escape(document.title.substring(0,150))+
        ";"+Math.random();</script><!--/LiveInternet-->

</div>
<script type="text/javascript" src="https://semalt.com/app/partials/timer-reputation.php"></script>
<!--    <script type="text/javascript" src="https://semalt.com/popups/new_popup_counters.php?ref=reputation&sec=3"></script>-->
<!--    <script type="text/javascript" src="https://semalt.com/popups/small_start_reputation_popup.php?ref=reputation"></script>-->
<!--<script src="https://semalt.com/js/din/popup_seo_cons.php"></script>-->
</body>
</html>