Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript error because of removal of $.browser from jQuery #183

Open
vlakoff opened this issue Mar 16, 2024 · 5 comments
Open

JavaScript error because of removal of $.browser from jQuery #183

vlakoff opened this issue Mar 16, 2024 · 5 comments

Comments

@vlakoff
Copy link
Contributor

vlakoff commented Mar 16, 2024

Webgrind 1.9.3

Encountering this JavaScript error:

jquery.blockUI.js:206 Uncaught TypeError: Cannot read properties of undefined (reading 'msie')

Code excerpt:

ie6: $.browser.msie && /MSIE 6.0/.test(navigator.userAgent),

Certainly due to the update to jQuery 1.12.4, as $.browser has been removed in jQuery 1.9.

Note there are also other occurrences of $.browser in the codebase: Search for "$.browser".

@vlakoff
Copy link
Contributor Author

vlakoff commented Mar 16, 2024

As a short-term solution, jQuery Migrate could be used, but it would be better to directly update the dependencies:

@vlakoff
Copy link
Contributor Author

vlakoff commented Apr 13, 2024

Hi @jokkedk, it seems that you are not active on this project currently. I can understand, there is absolutely no problem with this.

Though, the latest webgrind release can be considered as broken, considering how the jQuery update actually broke things that were working previously.

Thus, as a quick measure to fix things in the short term, maybe you could revert the jQuery update and tag a new webgrind release? Staying on the older -but working- jQuery version would be a lesser evil, for the time being.

@giuliopons
Copy link

giuliopons commented Jun 27, 2024

You can add this line:
<script src="https://code.jquery.com/jquery-migrate-1.4.1.js"></script>
after jquery.js in the templates/index.phtml

@dandjo
Copy link

dandjo commented Jul 12, 2024

@jokkedk would be greate to "hotfix" this issue with my merge request.

@AmirL
Copy link

AmirL commented Oct 16, 2024

Fix for dockerfile:

# Add jQuery migrate script after the jQuery script in index.phtml
RUN sed -i '/<script src="js\/jquery.js" type="text\/javascript" charset="utf-8"><\/script>/a\
<script src="https://code.jquery.com/jquery-migrate-1.4.1.js"></script>' /var/www/html/templates/index.phtml

or just in bash:

sed -i '/<script src="js\/jquery.js" type="text\/javascript" charset="utf-8"><\/script>/a\
<script src="https://code.jquery.com/jquery-migrate-1.4.1.js"></script>' /var/www/html/templates/index.phtml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants