I just finished the "Super Star" webinar that demonstrated some enhanced webparts that use the Jquery javascript (jquery.min.js) loaded in a document library titled "javascripts" on the top level site of the portal. After creating the library and loading the "jquery.min" file to this document library, I am unable to get the "localized" version of the webparts to work on my secure MOSS site using the default location within the web part (var jQPath = '/javascripts/'). Instead, I have to use the Source Editor each time I upload one of these web parts and change the jQpath pointer to my top site document library that contains the java script (var jQPath = 'https://sermcportal.amedd.army.mil/cops/imd-test/javascripts/'). How do I edit the source code of the web part so I don't have to manually update the pointer each time I import one of the custom webparts from the webinar?
Stump the Panel » End Users and Information Workers
Help with jQpath
(3 posts)-
Posted 3 days ago #
-
Eric - There are two ways to do it. Make the change locally on your harddrive to the web part you are using, or update the web part online, export it and replace your existing localized web part.
To make the change locally, move to the web parts folder you downloaded as a resource for the workshop. Open each web part in a basic text editor, like WordPad. Find the line that holds the variable pointing to "/javascripts/" and change it to the correct path on your SharePoint server. From that point on, when you upload the web part, you will not need to change it in the source online.
If hacking around inside the xml of the web part seems a bit much, export an existing web part on your site, one in which you have changed the path to the correct location. When exporting, overwrite the localized version in your web parts folder and you should be good to go.
You have to do that for each of the web parts we provided in the workshop.
Regards,
MarkPosted 1 day ago # -
Your web part should start like this in the source area:
<script type="text/javascript"> if(typeof jQuery=="undefined"){ var jQPath="/cops/imd-test/javascripts/"; document.write("<script src='",jQPath,"jquery.min.js' type='text/javascript'><\/script>"); } </script>
Posted 21 hours ago #
Reply
You must log in to post.