Qeb Archives: jQuery thiab SharePoint

Overcome Annoying teeb meem nrog tus kwv tij Urls hauv SharePoint ceev Launch

Kuv xav mus ntxiv ib qhov txuas rau tus ceev community launch navigation lwm hnub thiab SharePoint hais rau kuv:

image

Ntawv ntshiab version ntawd yog:

Xyuas kom qhov URL no siv tau pib nrog tog twg los ib tug cim uas koj siv tau (ib daim ntawv tooj (#) los luaj pem (/)) los yog ib tug siv tau txaus siab raws tu qauv (Piv txwv, ' http://’, ' https://’, ' ntaub ntawv://’, ' ftp://’, ' mailto:’, ' xov xwm:’).

"Blech thiab qoob!"Kuv hais.

Ib lub workaround rau qhov no yog siv cov JavaScript nrhiav ib qhov txuas paub tias nyob rau lub lub community launch ceev thiab override cov cwj pwm.

Sim no, ntxiv ib qhov txuas tshiab ntawd rau koj lub chaw kuaj thusly:

image

Kuv siv jQuery. Yuav kom daws tau nws, tau ib co JavaScript thiab jQuery mus rau ntawm nplooj ntawv uas siv cov txheej txheem yuav nyiam koj thiab nrog rau ib txoj kab kev cai zoo li no:

 

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

    $("ib tug:muaj('Kuaj URL hloov')").nyem(muaj nuj nqi () { alert("nias hloov tus cwj pwm!"); rov qab los tsis tseeb;});

});

Thiab Bob ntawv koj tus txiv ntxawm.

Cov jQuery selector pom txhua txhua <ib tug> lossis tau "Tshuaj ntsuam URL hloov" nws lub npe. Koj yuav tau xyuas-qhib uas nyob ntawm seb koj txuas thiab xws li.

Lub .click(muaj nuj nqi() xijpeem SharePoint yuav tau ua li cas thaum tus neeg siv clicked overrides. Xyuas kom tseeb tias koj "rov qab mus cuav" los yog mus yos nws yuav ua koj cov khoom thiab ces txhob href qhov dhau, Nws yog ib qho yuav luag yeej tsis koj lub hom phiaj no.

Qhov no yog ua li cas thiab kuaj hauv ib SharePoint hauv Internet chaw, tab sis yuav tsum ua hauj lwm zoo ua 2010 thiab dhau hwv.

</kawg>

undefinedSubscribe rau kuv blog.

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

Yooj yim thiab ceev thaum: Daws "Invalid URL Parameter” qhov teeb meem uas muaj UpdateListItems hauv lists.asmx

Thaum ua hauj lwm nrog cov UpdateListItems ntawm lists.asmx, Nws yog ib qho yooj yim uas ua kom muaj qhov yuam kev:

Invalid URL Parameter.

Qhov URL muaj muaj tus hais kom ua lossis tus nqi uas invalid. Thov khij qhov URL dua.

Koj yuav tau txais qhov yuam kev no thaum uas koj hnov qab xws li daim ID hauv cov daim ntawv uas teb yuav hloov.  Qhov no, zoo li ntau qhov kev pab no SP Web site, yog ib ntsis counterintuitive txij thaum koj yuav tau mus nrog tus ID tus ID attribute ntawm tus <Txujci> caij.  Thiab koj nyob nraum tsis tshiab ID thiab tej zaum koj yeej tsis xav ua tus thawj place.

No lub hnab ntawv uas tsis yog tshuaj ntxuav tes xwb:

<soapenv:Hnab ntawv xmlns:soapenv =' http://schemas.xmlsoap.org/soap/envelope/'>
  <soapenv:Lub cev>                      
    <UpdateListItems xmlns =' http://schemas.Microsoft.com/sharepoint/soap/'>                     
      <listName>{C712E2EA-54E1-47AD-9D99-1848C7773E2F}</listName>                     
        <tshiab>                     
         <Batch OnError ="Mus ntxiv">
          <Txujci ID ="1" Cmd ="Hloov tshiab">
            <Teb Name ="CooperativeLock">muab tub!</Teb>
            <Teb Name ="TUS ID">1</Teb>
          </Txujci>
        </Batch>                     
        </tshiab>                
      </UpdateListItems>             
  </soapenv:Lub cev>         
</soapenv:Hnab ntawv>

Yog hais tias koj tawm tus ID teb siv strip ces koj mam tau txais annoying "Invalid URL parameter" hais.

</kawg>

undefinedSubscribe rau kuv blog.

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

 

Tus txiv neej tsis tus Caching hauv JavaScript

[TL;DR version: siv cov ncuav qab zib kom cia ntsuam async hu; kav soj ntsuam lawm hais lus async tam sim ntawd thiab ces validate lawv tom qab nplooj load.]

Kuv twb tau ua rau ntawm qhov chaw intranet SharePoint rau ib tug neeg ntawd nta, cov lwm yam, ib stylized lwm yam navigation uas los ntawm kev xaiv zaub mov muaj tswj ntawm ib txwm qub kev cai sau.  Tsab cai idea yog tias tus neeg twg thiaj tau tus tswj "lawv" rau cov zaub mov uas tsis rau los muab cuam tshuam los ntawm lub ntiaj teb no navigation muab tso los ntawm nws.

(muaj dab tsi subversive incredibly txog ntxiv ib CEWP uas cov ntsiab lus rau ib tug HTML uas loads ib co CSS thiab JS fundamentally tshwm sim yuav luag txhua yam hais txog tus kawm li cwjpwm... tiam sis yog rau lwm tus ncej)

Qhov chaws kom yooj yim yuav zoo nkauj no:

  • Tos li cov nplooj ntawv kom tag rau nraum chaw thau khoom thiab muab ib tug async hu mus thauj tuaj tshuab raj ua ib yam khoom ntawm ib daim ntawv teev tas los yog lists.asmx los yog los xijpeem
  • Siv jQuery, dynamically populate ib Rev yog <lis>tus hauv ib tug niam txiv <ul> (saib cov Christian Pinder tsab xov xwm no rau lub vaj no tecnnique simplistic)
  • Kev siv CSS yuav ua txhua yam rau formatting
  • Nyiaj!

Tej teev hauv no mob ntawd yog txhua zaus thaum leej twg hits yog ib cov chaw nplooj, tus neeg ntawd lub web browser yog caw kom tau yam khoom los ntawm daim ntawv.  Thaum dev no tiav thiab kuaj tau proven yam yuav ruaj thiab teb, no hu no hu ruaj dua 99% lub sij hawm thaum cov zaub mov tsis tshua hloov.  Nws kuj muaj ib tug weird UI muaj uas muaj nyob rau qhov brave new world ntawm cus-ajaxy web sites – cov phab renders thiab xwb ces yog cov ntawv qhia zaub mov kav.  Nws yog jittery thiab distracting rau kuv saib.  Thiab jittery. Li ntawd, caching. 

Kuv raug kho qhov logic thusly:

  • Nrhiav ib cov kua nplaum uas nyob rau hauv qhov browser uas muaj daim ntawv qhia zaub mov li kuv kawg nyeem nws
    • Yog nrhiav tau, kav nws tam sim ntawd.  Tsis txhob tos txog rau sab mus tag rau nraum chaw thau khoom.  (Koj yuav tau xyuas kom tseeb tias koj cov HTML leeg muab tso ntawm no, tab sis nws yuav tsis ua zog).
  • Tos li cov nplooj ntawv kom tag rau nraum chaw thau khoom thiab muab ib tug async hu mus thauj tuaj tshuab raj ua ib yam khoom ntawm ib daim ntawv teev tas los yog lists.asmx los yog los xijpeem
  • Piv li kuv tau tiv cov kua nplaum uas
    • Yog hais tias nws qhov khoom, TSO TSEG
    • Txwv tsis pub, siv jQuery, dynamically populate ib Rev yog <lis>cov nyob hauv lub <ul>
  • Kev siv CSS yuav ua txhua yam rau formatting
  • Nyiaj!

Qee yam uas koj yuav hais, "hav! yog tsis muaj real caching mus rau hauv no vim muaj koj nyob nraum nyeem cov ntawv qhia zaub mov rau nkawv noj txhua txhua zaug uas koj nkaus xwb.”  Thiab koj nyob nraum txoj kev-kuv tsis muab rau tus neeg rau zaub mov ntais txhua yam.  Tab sis vim hu yog async thiab tshwm sim tom qab uas pib ntawm nplooj ntawv HTML payload siab renders, nws "yim" noog kom tus neeg siv.  Daim ntawv qhia zaub mov renders zoo nkauj ntau li cov nplooj draws.  Yog hais tias cov zaub mov zoo li yuav hloov, cov neeg siv yog nyuam ib jittery rov kos ntawm cov ntawv qhia zaub mov, tab sis lub caij ntawd xwb.

Yog cov kev ua no caching zoo tshaj thiab pab kom paub cov neeg rau zaub mov txhij:

  • Muab tso rau hauv ib txoj cai tias tus tus "kua nplaum uas cache" yog muaj tsawg kawg yog 24 teev los yog ib txhia timeframe. Tsuav yog tsis DRA cov kua nplaum uas, siv cov kua nplaum uas tshuab raj snapshot thiab tsis txhob ntaus cov neeg rau zaub mov.

Qhov tshij... uas txhua yam uas tuaj siab tamsim no :). 

Yog leej twg muaj tus muaj cov tswv yim ntse nov kuv yuav hlub kom paub tias lawv.

Thiab ntsig – cov txheej txheem no yuav raug siv rau lwm yam khoom.  No neeg sab muaj ntau yam ntaub ntawv-uas tau tsav ntawv teev rau phab ntau, muaj coob leej kuj tsis tshua hloov (zoo li ib zaug ib lub lim tiam los sis ib hlis ib zaug).  Yog tias koj phiaj txog tej chaw functionality, koj muab tau ib daim UI feem ntau yog rub cov ntsiab lus los ntawm cov kua nplaum uas nyob tom khw thiab rendering tam sim ntawd.  Nws yim sai rau cov neeg siv txawm hais tias koj nyob nraum tsis txuag cov neeg rau zaub mov twg Pest.  Koj tau txuag cov neeg rau zaub mov mus los ntawm kev txiav txim siab rau tej mob uas muaj tej yam rau invalidate no qhov chaw cov kua nplaum uas cache.  Li no tag situational thiab artsy khoom thiab tiag tiag mas kev lom zem :). 

</kawg>

undefinedSubscribe rau kuv blog.

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

XSLT thiab jQuery Samples

Kuv tau raug ua ntau heev nyob ntawm XSLT thiab jQuery, thiab kuv yuav muab ib ob peb snippets uas lwm tus tau nrhiav pab yav thought.

Piv txwv 1: Emit yooj yim JavaScript / jQuery hauv XSLT:

<xsl:Template match = "tej yam" xml:chaw = "khaws cia">

  <!– Dawb paug tawm tau cov lus nug cov ntxaij lim dej tus phooj ywg thaum teb –>
  <Script yam = "ntawv nyeem/javascript">
    $(daim ntawv).npaj txhij(muaj nuj nqi(){
      $("#QueryFriendlyFilters").val("tas");
    });
  </tsab ntawv>

</xsl:Template>

Tus ntsis emits ib co JavaScript waits rau ntawm nplooj los suaj kaum rau nraum chaw thau khoom (vim tias tus $(daim ntawv).npaj txhij(…)) hu ces poob lawm tus nqi thaum teb ua QueryFriendlyFilters mus rau cov nqi literal "tas".

Piv txwv 2: Siv <xsl:Yog hais tias> saib "ntau dua",  "tsis tau muaj", yam.

<xsl:Template match = "tej yam" xml:chaw = "khaws cia">

  <div daim id = "fdcAllFilters">
 
    <xsl:yog test="@Count>0">
      <ntsua kev kawm = "fdcFilterLabel">Lim tam sim no:</ntsua kev>
    </xsl:Yog hais tias>

    <!– ntxiv khoom zoo li no. –>

</xsl:Template>

Saum cov snippet nug saib puas yog ib tug attribute npe hu ua "Suav" ntawm cov "tej yam" caij ntau dua zero.  XML hauv qab no yuav ua ib yam dab tsi zoo li:”

<yam suav = "5" />

Piv txwv 3: Iterate los ntawm tag nrho cov ntsiab, interspersing jQuery hu.

<!– Iterate los ntawm txhua lub lim thiab tso saib qhov tseeb  kev mus. –>
<xsl:rau-ib qho = "UserFilter">

  <hoob kawm = "FilterHref" href = "javascript:mySubmitPage('RemoveUserFilter','{@ID}’)">[X]</ib tug>

  <ntsua kev kawm = "fdcFilterLabel"><xsl:tus nqi-cov select="@FilterValue"/></ntsua kev>

  <Script yam = "ntawv nyeem/javascript">

    $(daim ntawv).npaj txhij(muaj nuj nqi(){
        <xsl:ntawv nyeem><![CDATA[$("#QueryFriendlyFilters").val( ($("#QueryFriendlyFilters").val() + " ]]></xsl:ntawv nyeem>\"<xsl:tus nqi-cov select="@FilterValue"/>\"<xsl:ntawv nyeem><![CDATA["));]]></xsl:ntawv nyeem>
    });

  </tsab ntawv>

</xsl:rau-ib>

Saum cov snippet yog tus tshaj txoj thiab tej zaum yuav muaj txoj kev uas yooj yim ua.

Lub XML qab no zoo roughly li no:

<UserFilter ID = "123" FilterValue = "xyzzy" />

Cov snippet no yog ntsuas los ntawm <UserFilter> o. 

Nws xub emits ib lub thauj tog rau nkoj tag uas thaum clicked invokes ib JavaScript zoo uas twb yog nyob rau sab, "mySubmitPage" thiab kis tau tus nqi ntawm ib lub attribute lub <UserFilter> ntawm hu ua "ID". 

Nws mam li emits ib co jQuery waits rau rau sab mus thauj khoom.  Tus jQuery siab thaum teb hu ua "QueryFriendlyFilters" los ntawm kev ntxiv cov nqi ntawm qhov FilterValue attribute.  Nco ntsoov txhua lub crazy <xsl:ntawv nyeem> thiab <![CDATA[ … ]]> khoom.

Tus ntawd yog nws, vam tias nws yuav pab!

</kawg>

Subscribe rau kuv blog.

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

Lists.asmx, GetListItems thiab Folders

Kuv tau ua tej kev soj ntsuam rau ib tug neeg niaj hnub ncig lub list.asmx Web site pab muaj li ntawm SharePoint 2010 (thiab ua ntej lawm).  Nws tau txais cov ntawv teev khoom ntawm lub hauv paus sis (xws li lub npe ntawm sub-folders), tab sis, tsis tau txais cov khoom nyob rau hauv sub-folders.  Kuv puas tau ib co saib ib ncig ntawm lub internets, thiab nws yog ib qho kuj ceeb tias lo lus nug.  Tsis tau, Kuv tsis tau muab lus teb rau lo lus nug yooj yim zoo, "yog hais tias kuv paub lub ceev, cas kuv yuav tau txais cov khoom nyob rau hauv daim nplaub tshev?”  Yuav tsis ncaj ncees, Kuv ho tsis sim ib tag li vim kuv yeej xav kom daim duab no ib qho tawm ntawm kuv tus kheej ib pliag Luag nyav.

Teeb no, Kuv tsim ib qhov chaw uas hu ua "Blogging Scenarios" thiab cov kev cai sau npe hu ua "Kev cai sau nrog Sub Folders".  Kuv ces zoo folders muaj npe:

  • Xyoo 2005
  • Xyoo 2006
  • Xyoo 2007

Kuv tov ob peb yam khoom rau hauv daim nplaub tshev "xyoo 2006".  Qhov no yog qhov uas nws zoo li:

image

Tab sis kuv cov phooj ywg tsis yog sau ntawv C# code, theej siv Java, vim li ntawd hauv lub hnab ntawv uas tsis yog tshuaj ntxuav tes muaj li nws yeej tau.  Tau tias, Sau tau me ntsis txog cov jQuery thiab ces muab fiddler los mus sib tham HTTP txhua lub sij.

Nov yog yam hais txog cov jQuery (Tau kuv theej lub chaws los hauv qab no yog koj xav luam los muab tshuaj):

image

Lawv thawj qhov tseem ceeb yog kom muaj ob lub <queryOptions> thiab <QueryOptions> ntawm.  Tus yuam sij thib ob uas yog tus <Ceev> ntawm no ib URL uas tus neeg muaj ntaub.

Tej zaum yuav muaj lwm txoj kev kom tau no, tab sis qhov haujlwm zoo rau kuv thaum uas siv cov jQuery.

Nov yog lub hnab ntawv tshuaj ntxuav tes mus rau saum:

<soapenv:Hnab ntawv xmlns:soapenv =’http://schemas.xmlsoap.org/soap/envelope/’>                
  <soapenv:Lub cev>
    <GetListItems xmlns =’
http://schemas.Microsoft.com/sharepoint/soap/’>
      <listName>Kev cai sau nrog Sub Folders</listName>
      <viewFields>  
        <ViewFields>
          <FieldRef Name ='Title’ />
          <FieldRef Name ='EncodedAbsUrl’ />
        </ViewFields>
      </viewFields>
      <queryOptions>
        <QueryOptions>
          <Ceev>
http://demoserver1/Blogging Scenarios/npe/nchuav sau nrog Sub Folders los lub xyoo 2006</Ceev>
        </QueryOptions>
      </queryOptions>
   
</GetListItems>
  </soapenv:Lub cev>
</soapenv:Hnab ntawv>

Ntau cov lus piv ntxwv thiab kev sib sab laj nyob ib ncig ntawm no coj kuv ntseeg tias txhua yam kuv xav tau <QueryOptions> thiab hais kom meej nplaub tshev npe.  Rau kuv, Kuv xav kom neb ob leeg qhwv nws sab hauv <queryOptions> li zoo li qhia kom meej URL mas tsim nyog rau cov <Ceev> ntawm.

Ntawm no yog cov jQuery AJAX teeb:

$(daim ntawv).npaj txhij(muaj nuj nqi() {
       Var soapEnv =
           "<soapenv:Hnab ntawv xmlns:soapenv =’http://schemas.xmlsoap.org/soap/envelope/’> \
               <soapenv:Lub cev> \
                    <GetListItems xmlns =’http://schemas.Microsoft.com/sharepoint/soap/’> \
                       <listName>Kev cai sau nrog Sub Folders</listName> \
                       <viewFields> \
                           <ViewFields> \
                              <FieldRef Name ='Title’ /> \
                              <FieldRef Name ='EncodedAbsUrl’ /> \
                          </ViewFields> \
                       </viewFields> \
                       <queryOptions> \
                         <QueryOptions> \
                           <Ceev>http://demoserver1/Blogging Scenarios/npe/nchuav sau nrog Sub Folders los lub xyoo 2006</Ceev> \
                         </QueryOptions> \
                       </queryOptions> \
                   </GetListItems> \
               </soapenv:Lub cev> \
           </soapenv:Hnab ntawv>";

</kawg>

Subscribe rau kuv blog.

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

Lists.asmx, GetList thiab "tus nqi tsis raug null”

Kuv sab hnub uas cov GetList() txoj kev ua lists.asmx cov qhov Web site yog hu ua tib zoo heev lawm los sis yog nws muab pov ib mysterious kos "Tus nqi tsis tau thov" (thiab cov piv txwv uas yog tias koj tau txais yav tas los tseem heev tshaj generic yuam kev hais, "Kos yam ' Microsoft.SharePoint.SoapServer.SoapServerException’ ces muab pov twb tseg.")  Yeej, Kuv pom tias koj muab tsis tau prefix txhua yam nyob rau hauv cov txujci GetList.  Cov nram qab no jQuery snippet illustrates tus taw tes:

image

Yog hais tias ua li, qhov kev pab cov qhov web teb nrog "Tus nqi tsis tau thov" as per qhov no fiddler-yog muab HTTP transcript:

<?xml version = "1.0 Tub ntxhais" encoding = "utf-8"?>
  <xab npum:Hnab ntawv
     xmlns:xab npum ="
http://schemas.xmlsoap.org/soap/envelope/"    
     xmlns:xsi = "
http://www.w3.org/ 2001/XMLSchema-lom
     xmlns:xsd ="
http://www.w3.org/ 2001/XMLSchema">

  <xab npum:Lub cev>
    <xab npum:Txhaum>
      <faultcode>xab npum:Neeg rau zaub mov</faultcode>
      <faultstring>
        Kos yam ' Microsoft.SharePoint.SoapServer.SoapServerException’ ntawd ces muab pov tseg.
      </faultstring>
      <nthuav dav>
        <errorstring xmlns ="
http://schemas.Microsoft.com/sharepoint/soap/">
Tus nqi tsis tau thov.
        </errorstring>
      </nthuav dav>
    </xab npum:Txhaum>
  </xab npum:Lub cev>
</xab npum:Hnab ntawv>

tau mas, koj ntshe tsis ntxiv ntawd cov prefix "s0" ntawm tus kheej, tiam sis yog nws ua ib co cuab yeej (zoo li cov dab noj hnub).

Qhov no yog tag yim ruam tag / frustrating vim hais tias muaj lwm txoj kev tso ua kawg.  Piv txwv, lub GetListCollection txoj kev tsis mloog yog hais tias nws yog raug prefixed, Txawm tias yog muaj dev paus ua kawg xws li "xyzzy":

image

Qhov no "tus nqi tsis tau thov" rau nkawd MBDD ntau nrog lists.asmx hopefully li no yuav pab lwm tus neeg paub yav.

</kawg>

Subscribe rau kuv blog.

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

Endlessly Nesting <div> Ntawv cim npe thiab jQuery

Qhov no xws li tej tus oddball npe nkawd, Kuv tsis paub hais tias nws yog yeej muaj nqis blogging txog, tab sis cov uas ib txwm tsis lawm ua ntej kuv, yog li no peb yuav mus Luag nyav

Kuv tabtom haujlwm rau ib qhov project uas kuv tabtom rub tau tej ntaub ntawv los ntawm ib tug mus nrhiav, packaging nws rau hauv ib cov lus XML thiab ces tus XML yog kawg transformed rau HTML ntawm XSLT.  Muaj coob heev jQuery muab kev koom tes, ib ntsis uas implements tej cov tabbing functionality.  Thaum twg koj nyem rau ntawm ib tug tab (tiag tiag, ib tug <div>), jQuery invokes .hide() thiab .show() nyob rau ntau yam divs (cov nplooj pib load downloads cov ntsiab lus txhua yam thiaj li muaj muaj tsis muaj postbacks qhov no).

Ib Rev teev dhau los, tus tab switching logic pib coj erratically thiab nws tsis qhia ib qho kuv tabs.  Kuv kawg tracked nws mus txog ntawd qhov internet explorer (tsawg) xav hais tias tus <div> cim npe nested deb deb, deb ntxaum dua intended.Tus tsim tawm toolbar yuav qhia:

-<div daim id = "Tab1Content">
  -<div>
    -<div>
      -<div daim id = "Tab2Content">
        -<div>
           …………………………
                   </div>  <— kaw thaum kawg uas qhia nws tag kev cia rau no!

Li ntawd, Yog hais tias kuv ua ib $("#Tab1Content").nkaum(), Kuv kuj xav nraim Tab2 thiab kuv yuav tsis pom Tab2 yog hais tias kuv tsis tau qhia Tab1.  Tau theej thiab Document lub chaws rau studio siv qhov muag saib thiab nws yuav tsom hauv ob sab qhov div phlu tuaj tag nrho nicely, li lawv thiab yuav tau ua, saib zoo li no:

-<div daim id = "Tab1Content">
  +<div>
  +<div>
-<div daim id = "Tab2Content">
  +<div>
  +<div>

Tuav kuv lub taub hau tiv thaiv phab ntsa ib pliag thiab pom tau tias nyob hauv lub txoos HTML code tau generating empty heev <div> cim npe, zoo li:

<lub cev>

  <div daim id = "Tab1Content">

    <div daim id = "row1" />
    <div daim id = "row2" />

  </div>

  <div daim id = "Tab2Content">

    <div daim id = "row1" />
    <div daim id = "row2" />

  </div>

</lub cev>

(Cov saum no yog waaaaaaaaaaaay oversimplified.  Qhov khoob div cim ua npe yog siv tau lig. Qee yam ntawm kuv <div> cim npe tau tag nrho cov ntsiab lus, tab sis coob tshaj ntawd twb tsis tau.  Kuv tuaj hauv realization uas kuv <xsl:rau-ib> kev tswj tau emitting lub luv-daim ntawv div tags thaum twg tus xsl:rau-ib tsis ' nrhiav tej ntaub ntawv no.  Kuv yuam ua qhov HTML saib mus rau hauv lub qhov zis, li:

image

 

Tom qab kuv puas tau tias, tag nrho cov div lub lined nicely thiab kuv tab switching pib ua hauj lwm.

Li ib txwm, Kuv vam tias qhov no yuav pab lwm tus neeg nyob hauv lub pinch.

</kawg>

Subscribe rau kuv blog.

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

Tsis tau ntxiv jQuery–Resize ib qho piv txwv ua tus duab

Kuv pub ib cov qhov Web site ntawm ib tug neeg laus vendor thiab yuav ua tau ib qho teeb meem loj, me duab.  Cov dluab yuav tsum muaj 60×50 tab sis vim khib, tus thawj vendor yuam lawv ua 42×42, li ntawd, lawv nrhiav squashed:

 

Cov duab zoo

Teeb duab

Ntawm no yog cov markup (dog dig yooj yim zog):

<table hoob = 'ncua-outlook'>
  <thead>
    <tr>
      <th  dav ='100′>3 Tuesday</th>
    </tr>
  </thead>

  <tbody>
    <cov chav kawm tr = 'huab cua'>
      <Td dav ='100′>
        <ul>
          <lis hoob = 'high'>Siab: 72&deg;F</lis>
          <lis hoob = 'low'>Qes: 44&deg;F</lis>
          <lis hoob = 'mob'>Tshav ntuj
            <img src =’
http://deskwx.weatherbug.com/images/Forecast/icons/localized/60×50/en/Trans/cond007.png’ dav ='42’ qhov siab ='42’ xwm =” />
          </lis>
        </ul>
      </Td>
    </tr>

  </tbody>

</cov lus>

Koj mam li nco tias txawm ho lub kev ua kom cov duab xwb qhia qhov kom zoo dimension (60×50) tus thawj vendor yuam nws hauv 42×42.  Ua li cas?  Vwm.

Xijpeem, Kuv xav tau txoj kev sai thiab yooj yim tov rau no qhov teeb meem thiab kuv muab rau jQuery.  Qhov ua kom yuam kev los nrhiav tau txhua yam txog qhov tsim nyog tau <img> cim npe.  Kuv tsis xav muck cov cim kev lwm img npe (cov uas muaj ntau ntau).  JQuery no me ntsis puas tau qhov ua kom yuam kev:

<Script yam = "ntawv nyeem/javascript" src ="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></tsab ntawv>

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

         $(' li.condition > img').txhua(muaj nuj nqi (Performance Index, yam khoom)
           
{
             $(yam khoom).CSS("dav", "60"); 
             $(yam khoom).CSS(qhov "siab", "50");
            });
     }); // nyob rau daim ntawv load
</tsab ntawv>

Chaws ntawd me ntsis pom qhov sau los ua <lis> cim npe cov hoob kawm uas nws yog "mob" thiab <img> cov me nyuam.  Nws mam li iterates los ntawm tag nrho cov neeg ntawd.  Ua haujlwm zoo li ib lub nplhaib.

Kuv yuav zaum khiav nws, tab sis kuv yeej tsis muaj ib hom txiv leej tub unix tias solved π mus 18 xaus-npawb tsab precision sed thiab cov awk thiab kuv tsis ntawd seb yog jQuery guy tog twg los Luag nyav.

</kawg>

Subscribe rau kuv blog.

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

Siv ib lub kaw lus ceeb toom Pop-up thoob ntiajteb

Kuv thiaj sau tau ib tsab xov xwm rau www.sharepoint.briefing.com txoj cai"Siv ib lub kaw lus ceeb toom Pop-up thoob ntiajteb.”  No muaj nuj nqi DVR rau zej zog college sib txuas lus tsev kawm ntawv kaw vim yog daus li khuav. 

Nws yuav siv ib daim ntawv teev kev cai, mus rau ntawm lub box SharePoint web kev pab thiab ib co jQuery rau cov ua haujlwm.

Ntawm no yog ib teaser:

image

Nyeem tag nrho qhov nov: http://www.sharepointbriefing.com/features/article.php/3918471/Implement-a-Global-Pop-up-Notification-System.htm

</kawg>

Subscribe rau kuv blog.

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

Yuav tau tswj koj lawv xav tshuaj thiab rho nyees khawm

Kuv thiaj sau cov tshooj no ib while rov qab, tab sis looks li kuv tsis txuas rau nws los ntawm kuv cov blog lub sij hawm, yog li nov mus:

image

Cov tshooj no piav li cas sib zog newform.aspx mus rau ib sab redirect thaum cov neeg siv cov clicks lawv xav tshuaj thiab ib nplooj ntawv txawv thaum nws clicks cancel.

</kawg>

Subscribe rau kuv blog.

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