Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm struggeling with a weird behavior on some of my pages. It occurs both on plain site pages and on web part pages:

I have built various form-webparts and exported them. They all are referencing js-libraries stored in a public document-library. When I upload one of the exported webparts to a page, everything works fine, the libraries in the webparts are loaded and the sripts are executed.

Now when I add multiple webparts to one page, only one webpart is working. E.g. when I have a web part page and add 2 or more to it, only the one below the 2 others is loaded. All other webparts fail and there is the javascript error, stating that "Object doesn't support this property or method" - like the libraries with the plugins wouldn't have been loaded.

Is it simply impossible to have multiple form-webparts which all reference different js-libraries on one page?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You should check if js library is already on page if it is - don't add it second time if it is not on page - load it.

share|improve this answer
    
Thanks, avoiding duplicates seem to work. Though I noticed that on my "Development"-SP Sites referencing libraries multiple times and even mixing versions works smoothly. –  curmudgeon Oct 31 '12 at 13:41
    
In addition to @m.jedrzej: Everyone, make sure to always use "jQuery" instead of "$"! Will save you a lot of trouble ;) –  curmudgeon Oct 31 '12 at 15:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.