Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8085537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:09:13+00:00 2026-06-05T18:09:13+00:00

I have some accent issues in a shopping cart script. Here’s a part of

  • 0

I have some accent issues in a shopping cart script.
Here’s a part of my Javascript code :

//process product groups
        products.each(function(gid) {
            //create groups of products
            var gname = this.id.replace(/_/g, ' ');
            var gbutton = $('<a />',{'title':gname, 'prod_id':this.id,'href':'#'}).text(gname);
            $('<li/>').append(gbutton).appendTo(groups);

            //register onclick event for group link
            gbutton.click(function(e) {
                //make clicked group active
                groups.find('.active-group').removeClass('active-group');
                $(this).parent().addClass('active-group');
                //hide all groups 
                products.css('display','none');
                active_group = $('#' + $(this).attr('prod_id'), shop);
                //show only active group
                active_group.css({'top':0,'display':'block'});
                //animate products by shifting their top position and tweening opacity
                active_group.children('li').each(function(i){
                  $(this).css({'top':parseInt((i+settings.pageColumns)/settings.pageColumns)*settings.groupAnimationShift,'opacity':0});
                  $(this).delay(i*settings.groupAnimationStartDelay).
                  animate({'top':0,'opacity':1},settings.groupAnimationTime,settings.groupAnimationEasing);
                });
                //update number of pages
                active_group.current_page = 1;
                active_group.pages = Math.ceil(active_group.children('li').length / (settings.pageRows*settings.pageColumns));
                //update page scroll
                resetPageScroll();
                e.preventDefault();
            });

It is linked with UL id in the HTML

Ex. :

<ul id="Enseignes_Résidentielles">

                  <li class="product" name="RD-101" price="5" minimum="4" skip="4"> 
                         <a class="product-image fancybox" href="images/product_big.jpg" title="Picture 4">
                             <img src="images/product_2.png" alt="Preview"/>
                             <div class="text-overlay">
                              <p class="product-heading">Description</p>
                               Enseignes résidentielles imprimées sur 2 panneaux 4 mm 36” x 24” collés dos à dos.
                             </div>
                         </a>
                         <p class="product-heading">RD-101 (Simple)</p>
                         <a href="#" id="test" class="product-buy">Ajouter au panier</a>
                         <p class="product-meta">Double de pareterre 32x24</p>
                         <div class="product-price">18<span class="product-currency">$</span></div>

                    </li>

Everything is working except all the functions in the shopping cart DIV when I add accents and other punctuation to the UL id…
If my UL id does not contain accent or other utf-8 characters, it works fine.

Any idea why? And any idea how to fix this?


EDIT

Here’s the live project… : http://danalcoimpressions.com/remax/index.html
Try this…Click “Ajouter au panier” in any items in the first tab (Enseignes Résidentielles)…hover the shopping cart tab and try to add or delete items from that Category and it won’t work. But try the same thing in the 2nd tab (Enseignes Balcon) wich doesn’t have accent in the tab (UL) name…and it will work great in the shopping cart.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T18:09:14+00:00Added an answer on June 5, 2026 at 6:09 pm

    I think the problem is with this code:

    function itemRemoveHandler(p) {
      //look for item in cart
      var filter = /(\w+)::(\w+)/.exec(p.id);
      delete cart[filter[1]][filter[2]];
    

    JavaScript has terrible support for Unicode characters in regular expressions. In particular, the \w operator doesn’t work properly. Therefore, the match just doesn’t work so the delete line breaks.

    I’m not sure what to suggest as a workaround. You could keep the special characters out of “id” values, or else work on the regex.

    edit — OK confirmed; the regex, when applied to the string, doesn’t match the accented characters.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some script in my default page that redirects users to language specific
I have some Java code which performs bitwise operations on a BitSet. I have
I have some jquery code that is doing an ajax lookup and returning comma
I have some code which populates a hashtable with a question as the key
Edit: After addressing some issues that may or may not have been causing problems,
I'm trying to use SSLSniff's tool, and I have some technical issues... I've been
I have updated recently to IE 9 and I'm getting some strange issues. I
I have some serious (or better say: strange ) issues with the HTTP-header: Content-Encoding.
I have some existing C code that uses ICMP raw sockets to do Ping
Hello and good afternoon, I'm having some issues here, and to be honest, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.