શેરપોઈન્ટ ઝડપી લૉંચ માં સંબંધિત URL ને સાથે નકામી સમસ્યા દૂર

I wanted to add a link to the quick launch navigation the other day and SharePoint told me:

image

Pure text version of that is:

Ensure that the URL is valid and begins with either a valid character (a number sign (#) or forward slash (/)) or a valid supported protocol (ઉદાહરણ માટે, ‘http://', ‘https://', ‘file://', ‘ftp://', ‘mailto:', ‘news:').

“Blech and pox!” I said.

A workaround to this is to use JavaScript to find a known link in the quick launch and override its behavior.

To test this, add a new link to your test site thusly:

image

I used jQuery. To solve it, get some JavaScript and jQuery onto the page using your favorite technique and with a line of code like this:

 

$(દસ્તાવેજ).તૈયાર( કાર્ય () {

    $("એક:contains('Test URL replacement')").ક્લિક કરો(કાર્ય () { સજાગ("changed click behavior!"); પાછા ભૂલ ખવડાવનારું;});

});

And Bob’s your uncle.

The jQuery selector finds every <એક> tag that has “Test URL replacement” in its name. You may want to find-tune that depending on your link and such.

The .click(કાર્ય() overrides whatever SharePoint would have done when the user clicked. Make sure you “return false” or else it will do your stuff and then try to the href thing too, which is almost certainly not your goal.

This was done and test in a SharePoint online environment but should work well in 2010 and earlier too.

</અંત>

undefinedમારા બ્લોગ પર સબ્સ્ક્રાઇબ કરો.

Twitter પર મને ખાતે અનુસરો http://www.twitter.com/pagalvin

જવાબ છોડો

તમારું ઇમેઇલ સરનામું પ્રકાશિત કરવામાં આવશે નહીં. જરૂરી ક્ષેત્રો ચિહ્નિત થયેલ છે *