Post by rgbrewer » Sat Jul 15, 2017 4:35 am

What is the last line of your admin/view/javascript/common.js file?

Mine is

Code: Select all

})(windows.jQuery);
and while the file appears to work, if I edit it -- even just to add a comment -- save, and reload ... it fails at that line.

If I remove that line and end the file with a normal

Code: Select all

});
everything seems to work .. but I dont know the consequences.

Thanks!

New member

Posts

Joined
Sat Apr 22, 2017 9:30 am

Post by daveyoi » Sat Jul 15, 2017 5:44 am

You would have broken the auto-complete functionality with your change. It is creating a jquery "plugin" passing the windows.jquery object as a parameter to the $ of the function.

Autocomplete doesn't happen often in the frontend - Affiliates page only I think? So you probably didn't notice anything broken.

It might be better to post what it is you are trying to change and the actual error?

Image
Tristar Web Solutions


New member

Posts

Joined
Sun Oct 05, 2014 2:38 am

Post by rgbrewer » Sat Jul 15, 2017 7:11 am

I was trying to do something inside the on-click for $('#button-menu') ... I guess its better to do it in an external js file.

New member

Posts

Joined
Sat Apr 22, 2017 9:30 am

Post by rgbrewer » Fri Jul 28, 2017 11:47 pm

I am still entirely unable to edit common.js ?

Can someone please open catalog/view/javascript/common.js and simply put an empty line of text on line 1, save, and try and run the page.

In the console, do you get an error?

This is stock, out of the box, common.js with no edits made. If I change ANYTHING, the script fails and the developer console shows an error. A single comment added, a line space removed, anything.

Code: Select all


function getURLVar(key) {
	var value = [];

	var query = String(document.location).split('?');

	if (query[1]) {
fails

Code: Select all

//test
function getURLVar(key) {
	var value = [];

	var query = String(document.location).split('?');

	if (query[1]) {

New member

Posts

Joined
Sat Apr 22, 2017 9:30 am
Who is online

Users browsing this forum: No registered users and 17 guests