jQuery in web project

My web project works ok most of the time but sometimes when a page loads I get the following error. It happens probably once every 10 times you go into new pages. Has anyone seen this before or have any ideas what my be causing it.

2014-04-07 16:16:33
JavaScript Error:
Error: Could not execute returned javascript: Can’t find variable: jQuery
Source: document.getElementById(‘TDgE0P62’).style.userSelect = ‘none’;document.getElementById(‘TDgE0P62’).style.webkitUserSelect = ‘none’;document.getElementById(‘TDgE0P62’).style.MozUserSelect = ‘none’;

(function($){$.Zebra_Dialog=function(){var defaults={animation_speed_hide:250,animation_speed_show:0,auto_close:false,buttons:true,center_buttons:false,custom_class:false,keyboard:true,max_height:0,message:"",modal:true,overlay_close:true,overlay_opacity:".9",position:“center”,reposition_speed:500,show_close_button:true,source:false,title:"",type:“information”,vcenter_short_message:true,width:0,onClose:null};var plugin=this,options={},timeout;plugin.settings={};if(typeof arguments[0]==“string”)options.message=arguments[0];if(typeof arguments[0]==“object”||typeof arguments[1]==“object”)options=$.extend(options,typeof arguments[0]==“object”?arguments[0]:arguments[1]);plugin.init=function(){var e;plugin.settings=$.extend({},defaults,options);plugin.isIE6=browser.name==“explorer”&&browser.version==6||false;if(plugin.settings.modal){plugin.overlay=jQuery("

",{“class”:“ZebraDialogOverlay”}).css({position:plugin.isIE6?“absolute”:“fixed”,left:0,top:0,opacity:plugin.settings.overlay_opacity});if(plugin.settings.overlay_close)plugin.overlay.bind(“click”,function(){plugin.close()});plugin.overlay.appendTo(“body”)}plugin.dialog=jQuery("
",{“class”:“ZebraDialog”+(plugin.settings.custom_class?" “+plugin.settings.custom_class:”")}).css({position:plugin.isIE6?“absolute”:“fixed”,left:0,top:0,visibility:“hidden”});if(!plugin.settings.buttons&&plugin.settings.auto_close)plugin.dialog.attr(“id”,“ZebraDialog_”+Math.floor(Math.random()9999999));var t=parseInt(plugin.settings.width,10);if(!isNaN(t)&&t==plugin.settings.width&&t.toString()==plugin.settings.width.toString()&&t>0)plugin.dialog.css({width:plugin.settings.width});if(plugin.settings.title)e=jQuery("

",{“class”:“ZebraDialog_Title”}).html(plugin.settings.title).appendTo(plugin.dialog);var n=get_buttons();var r=jQuery("
",{“class”:“ZebraDialog_BodyOuter”+(!plugin.settings.title?" ZebraDialog_NoTitle":"")+(!n?" ZebraDialog_NoButtons":"")}).appendTo(plugin.dialog);plugin.message=jQuery("
",{“class”:“ZebraDialog_Body”+(get_type()!==""?" ZebraDialog_Icon ZebraDialog_"+get_type():"")});if(plugin.settings.max_height>0){plugin.message.css(“max-height”,plugin.settings.max_height);if(plugin.isIE6)plugin.message.attr(“style”,“height: expression(this.scrollHeight > “+plugin.settings.max_height+’ ? “’+plugin.settings.max_height+'px” : “85px”)’)}if(plugin.settings.vcenter_short_message)jQuery(”
”).html(plugin.settings.message).appendTo(plugin.message);else plugin.message.html(plugin.settings.message);if(plugin.settings.source&&typeof plugin.settings.source==“object”){var i=plugin.settings.vcenter_short_message?$(“div:first”,plugin.message):plugin.message;for(var s in plugin.settings.source){switch(s){case"ajax":var o=typeof plugin.settings.source[s]==“string”?{url:plugin.settings.source[s]}:plugin.settings.source[s],u=jQuery("
").attr(“class”,“ZebraDialog_Preloader”).appendTo(i);o.success=function(e){u.remove();i.append(e);draw(false)};$.ajax(o);break;case"iframe":var a={width:“100%”,height:“100%”,marginheight:“0”,marginwidth:“0”,frameborder:“0”},f=$.extend(a,typeof plugin.settings.source[s]==“string”?{src:plugin.settings.source[s]}:plugin.settings.source[s]);i.append(jQuery("

  1. how are you embedding jQuery ?
  2. when do you try to initialize this control ?

There’s decidedly a right way and wrong way to try & do this

There are some examples of how to wrap jQuery controls included in the Examples

You’ve got to wait until the jQuery library loads before trying to call into it. If it’s slow to load, you’ll get errors like this.

Hmm, I am not using it but I guess one of the plugins I am using is trying to use it. I am using the following plugins in the web project:

  • WCC
  • Graffiti
  • WEE
  • ActiveRecord
  • Elastic Web Page
  • M_String

Are you trying to set a control in the Open event ?

Since our framework doesn’t use jQuery its got to be one of those other items added to your project & you’ll need to ask those third parties whats wrong as I honestly can’t tell.