Responsive Ad Area

Share This Post


updating a multidimensional array stored in session storage

I have taken over a project and am not total familiar with JQuery and session storage. the issue is that after updating the info and clicking update it provides an error, “Uncaught SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse (<anonymous>)
at fillArray (main.js? [sm]:313)
at UpdateProduct (main.js? [sm]:234)
at HTMLButtonElement.onclick ((index):405)".

Included link to github repo:

function UpdateProduct() // called on click of an update btn

   // capture id from hidden element set in editproduct function
   var productId = $('#txtHiddenId').val();
   console.log("***** line:233 *****n product id =" + productId);
   console.log("***** line:235 *****n Fill array called!");
   console.log("***** line:237 *****n Bind Table called!");

// other functions 
function fillArray(prodid)
  console.log("***** line:310 *****n  Begin Fill Array");

  // find the item in the product array and update it
  JSON.stringify(productArray))), function (idx, v) 
  console.log("***** line:315 *****n " +;
  // Check if current prodid is the id wanted
  if ( === prodid) 
  {// ids match
    console.log("***** line:319 *****n product is's match");

    // populate data = productId;
    product.arrivalDate = $('#modalRequestedArrivalDate').val();
    product.productCode = $('#modalProductCode').val();
    product.description = $('#modalDescription').val();
    product.quantity = $('#modalQuantity').val();
    product.quantityType = $('#modalQuantityType').val();
    product.plant = $('#modalPlant').val();
    product.shippingMethod = $('#modalShippingMethod').val();
    product.specialInstructions = $('#modalSpecialInstructions').val();

    console.log("***** line:310 *****n  END Fill Array");

// bind table just updates the table.

updating a multidimensional array stored in session storage
updating a multidimensional array stored in session storage

Share This Post

Leave a Reply

Your email address will not be Publishedd. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>