Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Javascript showing on page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-23-2009, 01:16 PM
 
dprice80 dprice80 is offline
 

Newbie
  
Join Date: Jun 2008
Posts: 2
 

Default Javascript showing on page

For some reason on a MAC using Firefox Javascript is showing on this page.
www.italian-solutions.co.uk
the site has been moved around quite a bit and may have a few errors but i cannot figure out what can be causing this particular problem. There are 30 errors on the w3.org tool but i cannot see why any of them would cause the Javascript to actually be displayed in the browser body.

I cannot test it on a MAC as i dont have one and dont know anyone with a MAC so if someone could have a look at it i would be gratefull.

A few other problems with the website using a MAC are that registration does not seem to work properly, and a few people have reported problems with the contact form.

Really getting to me now. It looks like i am going to have to rebuild the whole site using 4.2.x

Perhaps i could just reinstall the template files using a fresh template and see how that goes. Any ideas anyone. Has anyone else had these problems?

Here is the Javascript that appears on the page.

Code:
0 && x > 0) top = top.substr(0, x)+thousand_delim+top.substr(x, top.length); cnt++; } return (bottom > 0) ? (top+decimal_delim +bottom.substr(1, bottom.length)) : top; } /* Substitute */ function substitute(lbl) { var x, rg; for(x = 1; x < arguments.length; x+=2) { if(arguments[x] && arguments[x+1]) { rg = new RegExp("\\{\\ {"+arguments[x]+"\\}\\}", "gi"); lbl = lbl.replace(rg, arguments[x +1]); rg = new RegExp('~~'+arguments[x]+'~~', "gi"); lbl = lbl.replace(rg, arguments[x+1]); } } return lbl; } function getWindowOutWidth(w) { if (!w) w = window; if (localBFamily == "MSIE") return w.document.body.clientWidth; else return w.outerWidth; } function getWindowOutHeight(w) { if (!w) w = window; if (localBFamily == "MSIE") return w.document.body.clientHeight; else return w.outerHeight; } function getWindowWidth(w) { if (!w) w = window; if (localBFamily == "MSIE") return w.document.body.clientWidth; else return w.innerWidth; } function getWindowHeight(w) { if (!w) w = window; if (localBFamily == "MSIE") return w.document.body.clientHeight; else return w.innerHeight; } function getDocumentHeight(w){ if (!w) w = window; if (localBFamily == "MSIE" || (localBFamily == "Opera" && localVersion >= 7 && localVersion < 8)) return isStrict ? w.document.documentElement.scrollHeight : w.document.body.scrollHeight; if (localBFamily == "NC") return w.document.height if (localBFamily == "Opera") return w.document.body.style.pixelHeight } function getDocumentWidth(w) { if (!w) w = window; if (localBFamily == "MSIE" || (localBFamily == "Opera" && localVersion >= 7 && localVersion < 8)) return isStrict ? w.document.documentElement.scrollWidth : w.document.body.scrollWidth; if (localBFamily == "NC") return w.document.width; if (localBFamily == "Opera") return w.document.body.style.pixelWidth; } function expandWindowX(w, step, limit) { if (!w) w = window; if (!step) step = 10; var go = true; var i = 200; while (go && i--) { if (limit && getWindowOutWidth()+step > limit) break; try { w.scrollTo(step, 0); go = (w.document.documentElement && w.document.documentElement.scrollLeft > 0) || (w.document.body && w.document.body.scrollLeft > 0); if (go) w.resizeBy(step, 0); } catch (e) { return false; } } return true; } function expandWindowY(w, step, limit) { if (!w) w = window; if (! step) step = 10; var go = true; var i = 200; while (go && i--) { if (limit && getWindowOutHeight()+step > limit) break; try { w.scrollTo(0, step); go = (w.document.documentElement && w.document.documentElement.scrollTop > 0) || (w.document.body && w.document.body.scrollTop > 0); if (go) w.resizeBy(0, step); } catch(e) { return false; } } return true; } /* Check list of checkboxes */ function checkMarks(form, reg, lbl) { var is_exist = false; if (form.elements.length == 0) return true; for (var x = 0; x < form.elements.length; x++) { if (form.elements[x].name.search(reg) == 0 && form.elements[x].type == 'checkbox' && ! form.elements[x].disabled) { is_exist = true; if (form.elements[x].checked) return true; } } if (!is_exist) return true; else if (lbl) alert(lbl); else if (lbl_no_items_have_been_selected) alert(lbl_no_items_have_been_selected); return false; } /* Submit form with specified value of 'mode' parmaeters */ function submitForm(formObj, formMode) { if (!formObj) return false; if (formObj.tagName != "FORM") { if (!formObj.form) return false; formObj = formObj.form; } if (formObj.mode) formObj.mode.value = formMode; formObj.submit(); } /* Analogue of PHP function sleep() */ function sleep(msec) { var then = new Date().getTime()+msec; while (then >= new Date().getTime()){ } } /* Convert number from current format (according to 'Input and display format for floating comma numbers' option) to float number */ function convert_number(num) { var regDec = new RegExp(reg_quote(number_format_dec), "gi"); var regTh = new RegExp(reg_quote(number_format_th), "gi"); var pow = Math.pow(10, parseInt(number_format_point)); num = parseFloat(num.replace(" ", "").replace(regTh, "").replace(regDec, ".")); return Math.round(num*pow)/pow; } /* Check string as number (according to 'Input and display format for floating comma numbers' option) */ function check_is_number(num) { var regDec = new RegExp(reg_quote(number_format_dec), "gi"); var regTh = new RegExp(reg_quote(number_format_th), "gi"); num = num.replace(" ", "").replace(regTh, "").replace(regDec, "."); return (num.search(/ ^[0-9]+(\.[0-9]+)?$/) != -1); } /* Qutation for RegExp class */ function reg_quote(s) { return s.replace(/\./g, "\\.").replace(/\//g, "\\/").replace(/\*/g, "\\*").replace(/\+/g, "\\+").replace(/\[/g, "\\ [").replace(/\]/g, "\\]"); } function setCookie(name, value, path, expires) { if (typeof(expires) == 'object') { try { var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; if (days[expires.getDay()] && months[expires.getMonth()]) expires = days[expires.getDay()]+" "+expires.getDate() +"-"+months[expires.getMonth()]+"-"+expires.getFullYear()+" "+expires.getHours()+":"+expires.getMinutes()+":"+expires.getSeconds() +" GMT"; } catch(e) { } } if (typeof(expires) != 'string') expires = false; document.cookie = name+"="+escape(value)+(expires ? "; expires=" + expires : "")+(path ? "; path="+path : ""); } function deleteCookie(name) { document.cookie = name+"=0; expires=Fri, 31 Dec 1999 23:59:59 GMT;"; } /* Clone object */ function cloneObject(orig) { var r = {}; for (var i in orig) { r[i] = orig[i]; } return r; } /* Get first checkbox and redirect to URL */ function getFirstCB(form, reg) { while (form.tagName && form.tagName.toUpperCase() != 'FORM') form = form.parentNode; if (!form.tagName || form.tagName.toUpperCase() != 'FORM' || form.elements.length == 0) return false; var selectedChk = false; for (var x = 0; x < form.elements.length; x++) { if (form.elements[x].name.search(reg) == 0 && form.elements[x].type == 'checkbox' && !form.elements[x].disabled && form.elements[x].checked) { selectedChk = form.elements[x]; break; } } if (!selectedChk) { if (lbl_no_items_have_been_selected) alert(lbl_no_items_have_been_selected); return false; } return selectedChk; } /* getElementById() wrapper */ function _getById(id) { if (typeof(id) != 'string' || !id) return false; var obj = document.getElementById(id); if (obj && obj.id != id) { obj = false; for (var i = 0; i < document.all.length && obj === false; i++) { if (document.all[i].id == id) obj = document.all[i]; } } return obj; } // undefined or not function isset(obj) { return typeof(obj) != 'undefined' && obj !== null; } // Check - variable is function or not function isFunction(f) { return (typeof(f) == 'function' || (typeof(f) == 'object' && (f+"").search(/\s*function /) === 0)); } -->

Also it says i am using 4.1.9 but the update script shows that i am using 4.1.10
__________________
4.1.9
Standard install
Reply With Quote
  #2  
Old 09-23-2009, 01:22 PM
 
dprice80 dprice80 is offline
 

Newbie
  
Join Date: Jun 2008
Posts: 2
 

Default Re: Javascript showing on page

as a sub note, that Javascript is from about halfway through the common.js file. I have tried updating the common.js file which had no effect.
__________________
4.1.9
Standard install
Reply With Quote
  #3  
Old 09-28-2009, 05:06 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: Javascript showing on page

What page is it being displayed on? I tried your link and it looks "normal" to me. I'm using Firefox and WinXP.
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:22 PM.

   

 
X-Cart forums © 2001-2020