0

I've been having some trouble integrating a JQuery background chooser with an IP.Board forum. I've tried including noConflict but it seems to disable JQuery completely. The code I'm using is this:

$("#Btn").click(function(){
    $("#Image").css("backgroundImage", "url('"+$("#ImageUrl").val()+"')");
});
  • Is there a console error? What is the value of `$("#ImageUrl").val()`? – tb11 Aug 08 '13 at 11:28
  • @tb11, No error that I know of. The value of `$("#ImageUrl").val()` would be the URL of the image the background image should be set to. – user2648420 Aug 08 '13 at 11:33
  • Can you replicate the error in a jsfiddle? The code you have looks good to me. – tb11 Aug 08 '13 at 11:41
  • @tb11, it works fine in a JSFiddle, as can be seen here: http://jsfiddle.net/Marcel/mSAsU/. I think the problem lies with jQuery conflicting with IP.Board's prototype.js library but I'm not sure how to get around it. – user2648420 Aug 08 '13 at 11:48

1 Answers1

0

Use jQuery(elem) instead of $(elem) or if you want to use $ then do what I did:

jQuery(function($) {
    // jQuery code goes here
});