Qeb Archives: jQuery thiab SharePoint

Nreeb taub: Ntxiv jQuery kom NTXHUAB Publishing phab

Thaum twg mus pab tau txoj NTXHUAB publising nplooj ntawv siv jQuery, Kuv ntaus lub pob loj hauv qab ceev tsawv:

Neeg rau zaub mov yuam kev hauv ' /’ Daim ntawv.


Parser kev ua yuam kev

Hauj lwm lawm: Ib qho kev ua yuam kev tshwm sim thaum lub caij cov parsing hauv ib qho chaw uas yuav tsum tau muab cov kev pab no thov. Thov nyeem qhov nram qab no parse kev yuam kev txhawb thiab hloov koj cov ntaub ntawv twg paab.

Lus sam yuam kev parser: Tsuas kawm ntawd tus ntawm lwm yam uas tau ntawm ib phab cov uas muaj cov ua ntawm lwm yam uas ncaj qha.

Qhov yuam kev:

 
Line 10: 
Line 11: 
Line 12: <script 
Line 13:     type="text/javascript" 
Line 14:     src="/jQuery/jquery-1.4.min.js"> 

Tau qhov twg los thov: /_catalogs/masterpage/KCC_FacultyMember.aspx    Kab: 12


Cov ntaub ntawv Version: Microsoft .NET moj khaum Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927

Nws twb yooj yim txaus los txhim kho (h/t rau kuv colleague, Uday Ethirajulu).  Nco ntsoov tias cov jQuery chaws nyob sab hauv lub "PlaceHolderAdditionalPageHead" li:

<asp:Chav ContentPlaceholderID = "PlaceHolderAdditionalPageHead" runat = "neeg rau zaub mov">

<tsab ntawv

    yam = "ntawv nyeem/javascript"

    src="/jQuery/jquery-1.4.min.js">

</tsab ntawv>

<Script yam = "ntawv nyeem/javascript">

  $(daim ntawv).npaj txhij(muaj nuj nqi() {

   // Ci ntsa iab jQuery khoom nov mus.

   });

</tsab ntawv>

</kawg>

Subscribe rau kuv blog.

Raws li kuv nyob Twitter tom http://www.twitter.com/pagalvin

Nyob rau ntawm jQuery qhuas Enhanced nrhiav-li-koj hom (los ntawm Jan Tielens)

Kuv tabtom ua haujlwm rau ib tug BPOS demo (tsis ntev yuav muaj txog li ntawm Microsoft lub site) thiab kuv xav ntxiv me ntsis pizzazz. Kuv twb paub txog Jan Tielen cov kev siv zog pab heev ib pliag thiab kuv xav tias nws yuav ib tug txheej txheem ntau ntxiv rau qhov demo, yog li kuv puas. Koj yuav nyeem tau hais txog nws ntawm no: http://weblogs.asp.net/jan/archive/2009/07/02/sharepoint-search-as-you-type-with-jquery.aspx. Nws yog ib qho uas kom yooj yim siv nws yuav zaum tau lub txim (thiab tej zaum muaj tej).

Kuv ntxiv cov ntsiab lus uas ob tug xwb los cas nws twb tsim / sau tau txog:

  1. Qhov no yog, qhov tseeb, ua hauj lwm hauv ib BPOS (SharePoint hauv internet) ib puag ncig.
  2. Yuav ua rau nws ua tsis tau ib qho annoying popup xov prefix tus siv rau lub tsev qiv ntawv jquery nrog cov https siv http, raws li nyob rau hauv:
<Script yam ="ntawv nyeem/javascript" src ="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></tsab ntawv>

Jan points kom paub tias koj yuav tsum zaum tsiv mus nyob lub tsev qiv ntawv nws tus kheej rau koj qhov chaw. Puas me ntsis tubnkeeg hnub no, I decided to blog about it instead 🙂

</kawg>

Qhov no yog ib qho rau kuv kuas series yuav ua li cas los siv jQuery nrog SharePoint.
Yog koj xav paub ntau ntxiv txog cov jQuery, Kuv mas xav: jQuery hauv nkaus ntawm Xyooj Bibeault thiab Yehuda Katz.

Subscribe rau kuv blog.

Raws li kuv nyob Twitter tom http://www.twitter.com/pagalvin

Ntawv cim npe Technorati:

Nkawd phiaj SharePoint npe/ntawv qiv Views (tsawm tsawv thiab) Tau nrog jQuery

Qhov no yog ib qho rau kuv kuas series yuav ua li cas los siv jQuery nrog SharePoint.
Yog koj xav paub ntau ntxiv txog cov jQuery, Kuv mas xav: jQuery hauv nkaus ntawm Xyooj Bibeault thiab Yehuda Katz.

Yog ib tus thawj yam uas kuv xav, thaum kuv pib ua si ib ncig nrog jQuery, Yog hais tias peb yuav siv nws luag ib SharePoint saib. Teb hais tias "tsis yog" (los yog tsawg kawg, Kuv yuav tsis thov tau). Txawm li cas los, yeej ua tau kom nyuaj heev rau cov neeg mus ntsib ib tug pom.

Kuv nrog kuv ib puag ncig sandbox pib thaum ua hauj lwm rau qhov no. Kuv thiaj sau txog qhov chaw ntawm no: Txoj kev sai thiab yooj yim: Sau koj tus kheej jQuery Sandbox rau SharePoint.

"Luag" ib saib, ua raws li cov kauj ruam:

  1. Ua kom muaj ib tug saib koj xav kom luag. Kuv tau ua uas thiab hu nws "Ruaj saib".

    Qhov no yog seb nws zoo li thaum nws tseem tsis "ruaj":

    image

  2. Ntxiv ib editor cov Web site qhov tus saib sab siv qhov ua kom yuam kev nyob hauv tsab xov xwm sandbox (i.e. ntxiv "PageView = Shared&ToolPaneView = 2 "rau qhov URL).
  3. Xyuas seb koj SharePoint _spUserId los ua raws li cov kauj ruam vwm, ntseeg los tsis:
    1. Teev rau hauv koj cheeb tsam SharePoint.
    2. Nyob hauv web browser lub chaw nyob teb, hom: "javascript:alert(_spUserId").
    3. Cov ntaub ntawv (Nws yog "13" hauv kuv tsev neeg).

      image

  4. Ntxiv cov nram qab no javascript koj CEWP nyob rau hauv txoj kev pom:

    <tsab ntawv yam ="ntawv nyeem/javascript"
        src =".. /.. /jQuery Library/jquery-1.3.2.min.js">
    </tsab ntawv>
    
    <Script yam ="ntawv nyeem/javascript">
      $(muaj nuj nqi() {
    
        alert(_spUserId);
    
        Var theSecuredView = $(' iframe[FilterLink * = ruaj % 20View]');
    
        Yog hais tias ((theSecuredView.length > 0) && (_spUserId == 13))
          $(' iframe[FilterLink * = ruaj % 20View]').niam txiv().niam txiv().niam txiv().html("<tr bgcolor = liab><Td>Tsis pom koj!</Td></tr>");
      });
    
    </tsab ntawv>
    

Kuv twb nyob ntawd alert(_spUserId) kab nyob ntawd mus li cas qhov no yog tsis muaj tiag tiag "phiaj" ib saib, tab sis tsuas ua nyuaj saib. Ntxiv rau cov uas nyob rau hauv ib pliag.

Yeej, jQuery nrhiav rau ib iFrame nyob rau sab uas tau muaj ib attribute uas muaj "Secured % 20View" nyob rau hauv nws cov nqi. Thaum nws pom nws, peb xyuas saib yog hais tias tus neeg siv tam sim no yog "13". Yog hais tias nws yog, peb mus pem lub DOM rau ib <TR> lossis (uas kuv figured los saib tau qhov twg los thiab nws tracing) thiab ho hloov ntawd tus TR lossis nrog kuv cov lus. Kuv yeej tsis paub li cas robust qhov no (Kuv yog tej yam txawv heev, qhov tseeb), tab sis nws ua hauj lwm nyob rau hauv kuv sandbox. Yog kuv nrhiav tau ib txoj kev zoo, Kuv mam li blog hais txog nws. Qhov no yog qhov no:

image

Kuv nias lub khawm tau thiab cov ntaub ntawv yog hloov rau liab lus loj loj:

image

Raws li koj hais, txoj kev uas kuv twb siv qhov "kev ruaj ntseg" tov yog cia qhov Web site los kav xwb. Tom qab nws finishes, Kuv overwrite nws cov ntsiab lus uas kuv "tsis pom koj!"lus.

Txawm fact ntawd nws tsis yog ib tug tiag tiag "secured'" saib, Nws yog ib qho uas uas pab tau thiab nrog tej chaw ua hauj lwm uas ntse, nws thiaj li yuav securable muaj kev txiav txim zoo tsim ntau. Tus kho qhov teeb meem yog tias tus neeg no tau txais tag nrho cov ntaub ntawv thiab luag, tsuas yog tom qab nws tau txais cov ntaub ntawv, muab cov ntaub so nws. Yog hais tias tus neeg no yuav tau txais cov ntaub ntawv, ib tus neeg ntse yuav tiv thaiv tau qhov jQuery ntawm khiav txhua thiab saib seb nws xav saib.

Muaj ntau lwm drawbacks. "Kev ruaj ntseg" kauj yog los so ib _spUserId. Peb yuav tau xav kom ruaj ntseg tiag raws li hauv daim ntawv qhia txog SharePoint ruaj ntseg qauv, los yog tsawg kawg los ntawm cov neeg siv lub npe. Ntawd yuav nyuaj zog progressively, tab sis, kuv pom ib co zoo khoom sau ntawv hauv no kawm, vim li ntawd kuv hopeful yog ib tug zoo teb tias teeb meem.

Yuav tsum tau trimmed daim ntawv ntawm lawv tus kheej views, yog ua tau. Kuv tsis tau sim uas paub tseeb. Kuv xav tias tej zaum, tab sis tsis tshua daws qhov kev ruaj ntseg uas siv no vim hais tias muaj ib tug neeg tseem nyuam qhuav ntaus qhov URL ntawm tus saib lawv xav (yog lawv paub). Txawm li cas los, trimming yuav ua rau kev txiav txim zoo. Nws yog ib tug zoo usability feature thiab yuav obfuscate khoom. Yog hais tias tus neeg siv tag tsis paub tias cov kev tshwm sim pom tshwm sim, lawv tej zaum yuav tsis txhob siv txoj kev no. Tej zaum, tias nws zoo txaus.

Cov tau koob hmoov, Kuv mam muaj ntau tshaj ntawm cov ntawv no sau lub sij hawm.

</kawg>

Subscribe rau kuv blog.

Raws li kuv nyob Twitter tom http://www.twitter.com/pagalvin

Ntawv cim npe Technorati: ,,

Txoj kev sai thiab yooj yim: Tus zoo tshaj los siv jQuery nkaum ntawv teb rau hauv daim ntawv SharePoint

Qhov no yog ib qho rau kuv kuas series yuav ua li cas los siv jQuery nrog SharePoint.
Yog koj xav paub ntau ntxiv txog cov jQuery, Kuv mas xav: jQuery hauv nkaus ntawm Xyooj Bibeault thiab Yehuda Katz.

Yav tas los, Kuv thiaj sau txog kev siv jQuery los nrhiav thiab nkaum teb ntawv rau ib daim ntawv. Kuv tsis tu ntawm tej kev (Kuv yog chaining niam txiv – uas ib tsab ntawv ua tsis yog hnub no, yam tsawg kawg hauv tsev neeg kom zoo).

Thaum twg kuv xub pib xav txog nws, Kuv paub kuv yuav nrhiav tau ib tug <TR> ua tau rau kom cov uas kuv yuav tus lub hide() txujci. Kuv siv zog thaum ntxov kom paub qhov tseeb <TR> muaj tej yam zoo li no:

$(' tr:muaj(tswv yim[Title = nraim kuv!])');

Qhov teeb meem ntawd yog tias nws nrhiav txhua txhua <TR> lossis yuav tsum muaj kev sib raug zoo leej niam leej txiv rau tus Hide kuv! teb, ntawd txawm tias kuv nkaum! yog nested muaj ntau theem hauv deep <TR>ntawv. Nws puv tawm uas rau kuv daim ntawv sandbox, pom ntawd qhia 9 txawv TR tus uas kuv nkaum! raws li tus me nyuam qhov chaw nyob hauv nws cov ntoo DOM. Kuv pom tau hais tias kuv yuav taug kev mus rau tsob ntoo los teb input xwb, yog li ntawd yog li cas kuv twb mus txhob niam txiv, tab sis nws tsis zaum zoo nrog kuv.

Kuv muab ib co thought rau qhov no thiab yog ib yam uas kuv nyeem txog thaum kawg tau paub: Kuv yuav siv cov tsis() txoj kev mus luas tawm <TR>Kuv tsis xav rau kuv nqa teeb tus. Uas coj kuv mus rau qhov no:

$(' tr:muaj(tswv yim[Title = nraim kuv!])').tsis(' tr:muaj(tr)').nkaum();

Thawj lub ntsis pom txhua tus <TR> cim npe thiab muaj lub Hide kuv! teb rau lawv tus kheej hierarchy. Strips nws ces paub ib yam <TR> tias tseem muaj ib tug me nyuam <TR>. Qhov yoojyim peb nrog ib leeg ib <TR> uas:

1) Muaj tsis muaj <TR> tus me nyuam cov ntaub ntawv

2) Muaj input teb raws li tus menyuam.

Ces yuav siv tus hide() qauv rau cov uas yuav ua tau zoo thiab peb nyob nraum ua.

Kuv tseem tshee kuj nce mentsis txog qhov no, tab sis, tsis li tshee ua chaining niam txiv.

Kuv tsis paub tias yog ib tug zoo licas los tsis. Tej zaum yuav muaj ib txoj kev zoo tshaj ntawm taw qhov cia li <TR> tias peb pab txog nyob rau hauv ib daim ntawv SharePoint. Yog koj paub, thov logged.

</kawg>

Subscribe rau kuv blog.

Raws li kuv nyob Twitter tom http://www.twitter.com/pagalvin

Ntawv cim npe Technorati: ,

Txoj kev sai thiab yooj yim: Siv jQuery nkaum ntawv teb rau hauv daim ntawv SharePoint

Qhov no yog ib qho rau kuv kuas series yuav ua li cas los siv jQuery nrog SharePoint.
Yog koj xav paub ntau ntxiv txog cov jQuery, Kuv mas xav: jQuery hauv nkaus ntawm Xyooj Bibeault thiab Yehuda Katz.

HLOOV TSHIAB (twb!): Kuv tsis xav tias muaj ib txoj kev zoo los nrhiav lub <TR> Kuv xav mus nkaum lossis thiab sau tau hais txog nws ntawm no. Koj kuj tseem nrhiav tau no Tshooj nthuav lawm ces kuv leavnig nws mus.

Kuv xav mus nkaum teb ntawv nyeem, "Nraim kuv!"thaum pom tias cov:

image

Cov nram qab no jQuery puas muaj qhov ua kom yuam kev rau kuv:

<Script yam ="ntawv nyeem/javascript">

  $(muaj nuj nqi() {


    $(' input[Title = nraim kuv!]').niam txiv().niam txiv().niam txiv().nkaum();

  });

</tsab ntawv>

Txoj cai hais tias, "xyuas nws npe fields input tag kuv = kuv nkaum!. Ces, tau nws cov niam txiv thiab cov ntawd ntxiv mus leej niam leej txiv thiab tus * * ntxiv mus leej niam/txiv (phew!) thiab ua tau rau tus muaj lub hide() txujci nyob ntawd tshaj plaws, txawm nws yuav tsis muaj.

Kuv figured tawm ntawd cov qauv niam/txiv uas saib cov HTML rau hauv daim ntawv ntawd SharePoint tsim li:

<TR>
    <TD nowrap= "nws muaj tseeb" valign= "top" dav= "190px" hoob= "ms-formlabel">
        <H3 hoob= "ms-standardheader">
            <nobr>Kuv nkaum!</nobr>
        </H3>
    </TD>

    <TD valign= "top" hoob= "ms-formbody" dav= "400px">
        <!-- FieldName = "nraim kuv!"
                 FieldInternalName = "Hide_x0020_Me_x0021_"
                 FieldType = "SPFieldText"
        -->
        <ntsua kev dir= "All">
            <tswv yim
                lub npe= "ctl00$ m$ g_bdb23c2c_fde7_495f_8676_69714a308d8e$ ctl00$ ctl04$ ctl02$ ctl00$ ctl00$ ctl04$ ctl00$ ctl00$ TextField"
                hom= "ntawv nyeem"
                maxlength= "255"
                tus ID= "ctl00_m_g_bdb23c2c_fde7_495f_8676_69714a308d8e_ctl00_ctl04_ctl02_ctl00_ctl00_ctl04_ctl00_ctl00_TextField"
                npe= "Nraim kuv!"
                hoob= "ms-ntev" />
                <br>
        </ntsua kev>


    </TD>
</TR>

Cov duab no qhia tau hais zoo li qub, tab sis ntawv rau cov niam txiv:

image

Thawj cov txiv (1) yog ib tug siab txog lossis. Tham nrog tus txiv (2) yog ib lub lossis TD thiab ces thaum kawg peb tau mus rau ntawm txiv kuv xav mus nkaum (3) Nws yog ib qhov TR lossis nws tus kheej.

Qhov no yog ib tug zoo nkauj heev tas zog kuv xav tias vim nws yog ib feem nyob daim qauv ntawm daim ntawv no kav. Thaum SharePoint 2010 ua li, qhov qauv tseem yuav hloov thiab lov no mus kom ze. Kuv yeej xav tau dabtsi ua yog khoom siv tes ua ib jQuery selector uas yog ib tus kab uas "nrhiav kuv txhua lub TR tus (thiab TR cim npe xwb) uas muaj qhov chaw nyob hauv lawv tus me nyuam hais ib input teb uas txoj kev cai title = nraim kuv!”. Txij qab thiab mus. Piv txwv tias yog kuv paub qhov no tseeb, Kuv mam li tswg kev kho tshiab "txoj kev sai thiab yooj yim ' tswg.

</kawg>

Subscribe rau kuv blog.

Raws li kuv nyob Twitter tom http://www.twitter.com/pagalvin

Del.icio.us cim npe: ,

Ntawv cim npe Technorati: ,

Txoj kev sai thiab yooj yim: Sau koj tus kheej jQuery Sandbox rau SharePoint

Qhov no yog ib qho rau kuv kuas series yuav ua li cas los siv jQuery nrog SharePoint.
Yog koj xav paub ntau ntxiv txog cov jQuery, Kuv mas xav: jQuery hauv nkaus ntawm Xyooj Bibeault thiab Yehuda Katz.

Tau pib nrog jQuery nyob SharePoint yog ib qho yooj yim kuj ceeb tias (rau kuv). (Kuv muaj lus nug heev txog peb ua ib tug "zoo kev" hauj deploying tej no mus ntau lawm, tiam sis yog lwm hnub). Kuv twb nyuam qhuav pib ua si nrog cov tshuab no thiab qhov kawg, Kuv tsim ib cheeb tsam sandbox siv. Yog koj nyob nraum nrhiav kom tau pib nrog jQuery, koj yuav nrhiav no mus kom ze pab tau.

1. Ua kom muaj ib qhov chaw dawb paug

Tsim ib cov dawb paug rau qhov chaw nyob hauv koj qhov chaw thiab hu xov tooj rau nws tej yam ntse ib yam li "jQuery Sandbox".

2. Download tau jQuery

Koj mus muab tau lub tsev qiv ntawv javascript jQuery ntawm no: http://docs.jquery.com/Downloading_jQuery

Uas yuav txuag tau koj desktop.

Kuv yeej tau siv cov "minified" version.

3. Tsim ib lub tsev qiv ntawv SharePoint daim ntawv

Nyob rau hauv koj lub chaw sandbox, ua ib daim ntawv qiv.

4. Upload jQuery tsev qiv ntawv los SharePoint

Ntaub ntawm doc qiv koj nyuam qhuav tsim thiab upload lub tsev qiv ntawv jQuery.

5. Tsim ib daim ntawv teev kev cai SharePoint

Kuv twb pib nrog rau ib daim ntawv teev kev cai vim kuv xav muck uas txheem ntaub ntawv SharePoint. Koj yuav kuj ua kom ib sab nyob rau hauv ib lub tsev qiv ntawv sau los yog nplooj ntawv qhov web thiab tej zaum ntau ntau qhov chaw.

Ntxiv ib co txhua daim ntawv kev cai kom koj muaj ib yam dab tsi kom khiav jQuery tiv thaiv. Kuv thiaj pib ua tiav lawm:

  1. Nkaum teb.
  2. Cob ib tug nqi rau ib lub teb.

Cov hom phiaj ntawd hauv siab, Kuv ntxiv ob phau ntawv teb. Thaum lub sij hawm, Ua kuv mam li ua si nrog kev mus, dluab, lookups, yam.

6. Hloov cov nplooj ntawv Part NewForm.aspx Web thiab ntxiv lub ntsiab lus Editor Web site qhov

Qhov no nws yog me ntsis dub magic-ish , rau qhov hais tias nws yog lub tswvyim tshiab rau kuv. Kuv xub kawm txog qhov no los ntawm Paul Grenier, SharePoint jQuery Superstar, nws CodePlex yog ib qhov site: http://spff.codeplex.com/.

Ua raws li cov kauj ruam mus ntxiv ib CEWP mus rau ntawm nplooj ib yam uas pom tias yog NewForm.aspx txog tej kev cai:

  1. Saib daim ntawv kev cai thiab nyem qhov New.
  2. Append hauv qab no rau qhov URL: PageView = koom&ToolPaneView = 2

Uas yuav txia koj boring vanilla tej ntaub ntawv nkag teb chaws daim ntawv los ntawm tej yam zoo li no:

image

Rau qhov no:

image

Ntxiv cov editor web ib sab mus rau sab.

7. Sau koj cov thawj jQuery Code

Qhib tau ntawd CEWP hauv txoj cai saib thiab ntxiv cov nram qab no:

image

Nov yog lub chaws txoos yog koj xav luam los muab tshuaj:

<tsab ntawv yam ="ntawv nyeem/javascript"
    src =".. /.. /jQuery Library/jquery-1.3.2.min.js">
</tsab ntawv>

<Script yam ="ntawv nyeem/javascript">
  $(muaj nuj nqi() {

    $('#resultsID').html('Muaj cov' + $('ib').loj() + 'ib cim npe cim npe rau phab no.');

  });
</tsab ntawv>

Ntog:
<div daim id ='resultsID'></div>
/ntog

Nco ntsoov tias tus ua ntej <tsab ntawv> lossis referencing lub tsev qiv ntawv sij jQuery. Txawm, tej no hloov lub sij hawm, ces koj mam li xav kom koj ib tug) siv lub npe zoo thiab b) taw tes rau qhov tseeb SharePoint daim ntawv qiv.

Bask hauv lub hwjchim ci ntsa iab

Yog tias koj ua nws thwj, koj yuav pom muaj tshwm sim zoo li cov nram no:

image

Wrapping tuaj

Qhov no tsis yog tib txog kev mus pib, tiam sis nws tseem ceev, ib qho yooj yim thiab hauv koj ib SharePoint nyob.

</kawg>

Subscribe rau kuv blog.

Raws li kuv nyob Twitter tom http://www.twitter.com/pagalvin

Ntawv cim npe Technorati: ,

Del.icio.us cim npe: ,

Txoj kev sai thiab yooj yim: Siv jQuery teev A ntawv teb tus nqi rau ntawm daim ntawv SharePoint

Kuv pib ua si ib ncig nrog jQuery nag hmo. Kuv twb tau xav ua li no kom ntev, ever vim Paul Grenier pib sau nws series hais txog jQuery rau cov neeg siv cov kev xaus ntawm qhov venerable www.endusersharepoint.com qhov Web site. Raws li kuv siv nws, Kuv cia siab ntxiv hauv "Ceev thiab yooj yim" zoo li no tuaj posts. Tsev xa no piav tau paub ntawv teb tus nqi rau tej yam koj xav li cas.

Hauv no scenario, Kuv tau tsim ib daim ntawv teev kev cai uas tus "tshiab" daim ntawv zoo li:

image

Qhov no yog daim tshiab rau ib daim ntawv teev kev cai nrog rau lub neej ntawd Title sab thiab ob daim ntawv teev txhua (tsis kawm ntawv txhua; Kuv tsis xav tias nws yuav tsum xyuas txhua qhov sib txawv).

Lub hom phiaj yog mus cob ib tus nqi uas arbitrary rau tom daim teb, "DefaultMeFieldNoSpaces" (koj yuav paub kuv yog ib tug coward nrog cov khoom mus "tej qhov tsis muaj chaw" me ntsis, tab sis kuv spice nws kawg ntawm qhov tsab xov xwm no).

JQuery ua haujlwm rau kuv no me ntsis:

<Script yam ="ntawv nyeem/javascript">

  $(muaj nuj nqi() {

    $(' input[Title = DefaultMeFieldNoSpaces]').attr(
        {tus nqi: ' Koj yog ib tug tshawb txog ntawm daim zajlus twisty, xwm yeem xwb.'});

  });

</tsab ntawv>

Raws li kuv nkag siab hais tias jQuery no me ntsis yog tias, "nrhiav kuv tej tswv yim tag nws txoj kev cai title = DefaultMeFieldNoSpaces. Ces, teev tas nrho txog lawv qhov tseem ceeb rau ib kab lus uas muaj koob npe los ntawm ib lub computer qhov qub."

Vim yuav tsuas muaj ib daim teb nyob rau hauv daim ntawv uas muaj title sib npaug zos rau cov "DefaultMeFieldNoSpaces" peb yog cov assured uas muab ib tug nqi rau ntawd daim teb thiab lwm yam tsis muaj.

Dab tsi txog nws lub npe muaj tej qhov chaw nws nyob hauv teb? Nws tseem yuav luag sib npaug:

<Script yam ="ntawv nyeem/javascript">

  $(muaj nuj nqi() {
     $(' input[Title = cob teb muaj chaw]').attr(
        {tus nqi: ' Koj yog ib tug tshawb txog ntawm daim zajlus twisty, xwm yeem xwb.'});

  });

</tsab ntawv>

Kuv xav tias qhov no yog ib tug zoo haum mus kom ze, peb qab hau tias peb yuav tsum tau nrhiav teb tias peb xav thiab lub teb xwb xav. Yog koj saib cov HTML SharePoint yog muab rau peb, nws puas tsawm tsawv thiab ntxhov:

<tswv yim
lub npe= "ctl00$ m$ g_bdb23c2c_fde7_495f_8676_69714a308d8e$ ctl00$ ctl04$ ctl02$ ctl00$ ctl00$ ctl04$ ctl00$ ctl00$ TextField"
hom= "ntawv nyeem"
maxlength= "255"
tus ID= "ctl00_m_g_bdb23c2c_fde7_495f_8676_69714a308d8e_ctl00_ctl04_ctl02_ctl00_ctl00_ctl04_ctl00_ctl00_TextField"
npe= "DefaultMeFieldNoSpaces"
hoob= "ms-ntev"
/>

"title" stands raws li ib tug coj los thiab cim hopefully attribute yuav pab peb xyuas seb tej sab uas peb xav mus cob peb tus nqi uas arbitrary.

Qhov no yog ib cov tswvyim foundational. Teev ib daim teb nyob rau hauv ib txoj kev arbitrary li no tsis yog yuav los yeej muaj khoom plig. Txawm li cas los, Yog tias peb xav kom ua li nthuav daim ntawv theem khoom (twg tagnrho uas peb ib txwm xav ua, tau mas, tom qab peb tas ntxuav tais diav), li hloov tau tus nqi ntawm "teb b" txiav raws tus nqi ntawm "teb ib", peb (KUV) yuav tau paub tej no.

Kuv xav tias peb zoo sij hawm kom tau ib pab real nqi nov yog ntawm lub npe, kawg rau ntawv teb. Muaj tej zaum yuav zoo dua, kev txhim khu ntau kev qha. Yog kuv nrhiav tau, Kuv mam li hloov no ncej. Yog koj paub ib txoj kev zoo, thov cia ib tug saib.</kawg>

</kawg>

Subscribe rau kuv blog.

Raws li kuv nyob Twitter tom http://www.twitter.com/pagalvin

Ntawv cim npe Technorati: ,