Adding SPServices via CEWP: Works, but getting TypeError in FireBug

Dec 19, 2012 at 11:38 AM

So, I tried to install SPServices in my SiteCollection for I want to create a contact form visual web part with cascading dropdowns (use-case: Having Events and Attendees, 2 Dropdowns, first "event title dd", second "attendee dd" -> change event, show attendees in the other dropdown ... and text modules too, and lookup columns, and... yeh, I hope this will work any time in the future ;) anyways...) so first I tell you how I added it, then the problem, and then I hope someone could help me ;)

What I did (on SP 2010 Server):

1) added jquery (1.8.0 min) to a previously-created document library called "scripts"

2) added spservices 0.7.2 min to the same library

3) created a new File initSPServices.js with the following contents:

 

<script type="text/javascript"> 
alert ("js on.");
$(document).ready(function() {
    alert ('jQuery on.');
    var thisSite = $().SPServices.SPGetCurrentSite();
    alert ('Hello World! Your site is : ' + thisSite );
});

</script>

4) Created a page "contactform.aspx" in Website Sites library.

5) added a CEWP Webpart

6) Linked to my initSPServices.js file via "edit web part" settings

7) Tested. All Alerts are shown the right way! yay! ....or?

8) Started Firebug

9) Got the following error:

 

TypeError: $v_0 is null
[Bei diesem Fehler anhalten] 	

var $v_1 = $v_0.parentElement();
(occurs in sp.ui.rte.debug.js, function: RTE.Canvas.checkCurrentFocus = function()...)


So now I am not sure if everything is correct. Would be nice to get an answer here for how to prevent this error or if this is actually "wanted" behaviour.

Best Regards, Dominik







 

Coordinator
Dec 20, 2012 at 12:26 AM

Dominik:

That error refers to sp.ui.rte.debug.js, which is one of SharePoint's .js files. I'm not sure what's happening. I think you'll need to do some debugging.

M.