|
Server : Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 System : Linux server.jackjohnson.com 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64 User : jackjohn ( 502) PHP Version : 5.3.17 Disable Function : NONE Directory : /home/jackjohn/public_html/publish/ |
Upload File : |
(function($){
$.ssAddToCart = function(op) {
var settings=$.extend(true,{},op),
displayPopUpFunc = settings.displayPopUp,
preAJAXfunc = settings.beforeAddToCart,
ssAJAXCartCall = function(url, data) {
if(typeof(preAJAXfunc) == 'function') preAJAXfunc(data);
$.ajax({url:url,data:data,async:true,crossDomain:true,dataType:'jsonp',jsonp:'show_jsoncart',success:displayPopUpFunc});
};
if(typeof(displayPopUpFunc ) == 'function') {
$("form[action*='order.cgi']").each(function () {
if($("input[name='function']").val().toLowerCase() != 'add') return true;
var f = $(this);
f.submit(function(event){
var error=false;
$('[name*=":finopt:"]',f).each(function(){
if(/;n/.test($(this).val()))
{
$(this).addClass('field_warn').change(function(){$(this).removeClass('field_warn')});
error="This product requires a menu selection";
}
});
if(error)
{
if(typeof(ss_handleResponse)=='undefined'){alert(error)}
return false;
}
event.preventDefault();
var data='';
//Avoids problems with encodeURIComponent and High ASCII
$(f.serializeArray()).each(function(){
var t=$(this)[0];
data+='&'+ escape(t.name)+'='+escape(t.value).replace(/\+/g,'%2B');
});
ssAJAXCartCall(f.attr('action'),data.substr(1));
});
});
$("a[href*='order.cgi'][href*='function=add']").click(function (event) {
var f = $(this),href=f.attr('href').split('?');
event.preventDefault();
ssAJAXCartCall(href[0],href[1]);
});
}
}
})(ss_jQuery);