jquery load using mysql database was working fine, then lately I've been getting an error -
i have code works this.
index.php file loaded , pulls information mysql database build dropdown jump menu.
when menu used, jquery called , tries load specific contact database overlay window.
it working fine , haven't changed recently. looked @ errors in chrome , beyond knowledge.
here error xmlhttprequest cannot load http://www.google.com/jsapi. origin [my domain] not allowed access-control-allow-origin. jquery.min.js:6 uncaught error: network_err: xmlhttprequest exception 101
here jquery (i don't show php, because seems working fine)
$j('#finddist').change(function(e){ e.preventdefault(); var intregex = /^\d+$/; var isnumeric = this.value; if(intregex.test(isnumeric)) { var loadurl = 'http://www.accumetrics.com/en?option=com_contactenhanced&view=contact&id='+this.value+'&tmpl=component&task=preview'; var width = 340; } else { var loadurl = 'http://accumetrics.info/accumetrics.com.v3/us-distributors?tmpl=component&task=preview'; var width = 940; } $j("#somediv").dialog({ autoopen: false, modal:true, width: width, overlay : { background: '#000', opacity: '0.9' }, show: { effect: 'fade', duration: 700 } }); $j("#loading").html(ajax_load); $j("#somediv").load(loadurl, null, function(responsetext){ // alert("response:\n" + responsetext); $j("#somediv").dialog('open'); $j("#loading").fadeout(200); }); $j("#somediv").dialog( "option", "position",[top,center]); });
chrome barking @ call jquery error. try in different browser , see if still error, bad call stored in cache.
while i'm here, might application of jquery ajax.
break out data appropriate strings:
var loadurl,loaddata,width; if(intregex.test(isnumeric)) { loadurl = 'http://www.accumetrics.com/en'; loaddata = {option:'com_contactenhanced', view:'contact', id:this.value, tmpl:'component', task='preview'}; width = 340; } else { loadurl = 'http://accumetrics.info/accumetrics.com.v3/us-distributors'; loaddata = {tmpl:'component', task:'preview'}; width = 940; } then apply appropriately in load.
$j("#somediv").load(loadurl, loaddata, function(responsetext){ when using jquery ajax function, separate data url appropriate object. not make maintaining lot easier, allows jquery form appropriate query string, rather forcing on you.
Comments
Post a Comment